For my Programming 102 class we are asked to deliver C code that compiles and runs under Linux. I don\'t have enough spare space on my hard drive to install Linux alongside Wind
A segmentation fault is the result of accessing memory at a non-existent (or previously freed) address. What I find very interesting is that the code did NOT segfault under cygwin. That could mean that your program used a wild pointer to some other processes' address space and was actually able to read it (gasp), or (more likely) the code that actually caused the segfault was not reached until the program was run under Linux.
I recommend the following:
Once your working under Linux (i.e. shelled into your VPS), try working with the following programs:
Also, you can try libraries like electric fence to catch these kinds of things as they happen while your program is running.
Finally, make sure -Wall is passed to gcc, you want the warnings it would convey.