Dynamic data definitions in C

Karl Thoroddsen karlth at rhi.hi.is
Mon Feb 25 23:08:06 AEST 1991


I have implemented linked lists in the following manner:

typedef int DATA

struct LIST 	{
		DATA *data;
		LIST *next;
	    	}

void create(struct LIST *list) etc. etc(other functions).
This is then compiled and can be linked into my programs.

Now I have defined the DATA to be 'int', but what if I needed to use
2+ lists in my program, each with different data definitions(int, float etc)?   
So my question is: Is it possible to define data structures(DATA) at runtime 
for example to create(name,DATADEF)?

Thanks in advance


-- 
Karl Thoroddsen             Computer Science           University of Iceland
----------------------------------------------------------------------------
----------------------------------------------------------------------------



More information about the Comp.lang.c mailing list