Declaration puzzler (another old question?)

William E. Davidsen Jr davidsen at steinmetz.ge.com
Thu Oct 6 00:45:25 AEST 1988


In article <30091 at oliveb.olivetti.com> chase at orc.olivetti.com (David Chase) writes:
| I can't figure out how to declare the type of an array with (say) 10
| elements, each of which is that array type.  That is, I want the
| non-error effect of
| 
| 	typedef foo *(foo[10]);

why not:
	typedef int foo[10];
	typedef foo *bar;

Perhaps that will do what you want to do, if not the way you want. The
token after the 'typedef' must be a type, and it seems that foo doesn't
become a type until after compilation of the typedef.
-- 
	bill davidsen		(wedu at ge-crd.arpa)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list