Thanks for all the replies - after looking through the code and checking all the pointers with the debugger and finding that they were not ever pointing at zero, I started getting messages about structure declarations with missing ;s being mistook for part of main() prototypes. Sure enough, that's what the problem was. Murff...