What is correct Ansi way of passing pointers to structures

Frank [Who me?] Kuan kuan at iris.ucdavis.edu
Fri Jun 8 10:32:32 AEST 1990


With Aztec C Compiler, there's an option to automatically generate
prototypes, but it gets confused with typedefs. For Example:

typedef struct {
	int x,y;
} funstuff; 


void dofunstuff(funstuff *p)
{
...
}

The prototype generated by my compiler looks something like:

void dofunstuff(struct *funstuff)

Does anyone know why this is? 
right now, what I've done to fix it is to declare
it like this:

void dofunstuff(void *p)

and then cast it to point to what I want to within the routine.
This is cumbersome and unelegant. What is the proper way to do
things?

Thanks in advance.



More information about the Comp.lang.c mailing list