Will Dyson on Sun, 8 Dec 2002 20:13:05 -0500 |
Jeff Abrahamson wrote:
My read of K&R is that, as long as you don't need to know the size of the struct pointer, you don't need to have the definition of the struct available in the current translation unit. What you need is a forward declaration of struct bar; You are correct that it does not need the definition, but it must know that struct bar is declared. struct bar; // forward declaration of struct bar int foo(struct bar *b); struct bar { int a; }; int foo(struct bar *b) { return 0; }
_________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce General Discussion -- http://lists.netisland.net/mailman/listinfo/plug
|
|