Originally Posted by
grumpy
The code, however, would not give a segmentation fault, since the main() attempts to convert a pointer to "struct node" into a pointer to "struct NODE" in various places (lines 35, 53, and 55, on a quick skim). A "struct node" is not a "struct NODE" so the conversion is invalid. Your main function will not compile, and the compiler will complain bitterly about the lines I pointed out (if not others).
So, unless your compiler itself is crashing, or "codepad" is crashing, I don't believe your claim that your program is yielding a segmentation fault.