[comp.sys.mac.programmer] typdefes in THINK C

mcdonald@fornax.UUCP (Ken Mcdonald) (01/22/90)

I'm having some problems using typedefs in THINK C.  I'm writing a small
program; in the header file, I declare a struct foo:

	struct foo { . .^6< . };

Then I use arguments which are arrays of foo in functions:

void f ( struct foo v[] )
{ . . . }

OK, great soo far.  But, I don't like always having to put in the struct
in the function definitions.  So, I change things:

	typedef struct { . . . } foo;

and

	void f (foo v[])
		{ . . . }
But now checking the syntax gives me an error--depending on the exact
configuration of the files (I've played around with moving text), either
an "Illegal function prototype" error, or, even more confusingly, an
"Missing ')'" error.  This last one is really weird, because I ddid a search
for unmatched opening parentheses, and there definitely weren't any!

Can somebody please tell me what the heck is going on?

Ken McDonald
mcdonald@lccr.cs.sfu.ca