segmentation fault

This is a discussion on segmentation fault within the C Programming forums, part of the General Programming Boards category; i fixed it. i simply had to add
Code:
void *__gxx_personality_v0;
to the code....

Then, if that doesn't work, post your exact code, so we can try compiling and toying with it. Also, it might help if you gave us your gcc version. Though unlikely, it may be a bit outdated, or have a known bug.

I just saw that you "fixed" it (your replied while I was writing my reply), but really, declaring that variable to shut the compiler up is a hack, not a fix. There is something strange about how your code is being compiled. For example, file names in Linux are case sensitive, so if it was .C (uppercase) instead of .c, gcc would assume it's C++, and try to compile it as such.

Also, provide the exact command you used to compile it. By exact, I mean copy and paste it from your terminal or IDE. You may have done that in post #15, or you may have simply looked at the command and retyped it by hand, omitting something critical like an uppercase .C extension.

Also, I know you posted your code in the first post, but you changed it since then, possibly you changed several things. That means we don't know the exact state of your current code, so we can't exactly replicate your problem, and it's hard for us to fix it.

I'm just trying to be thorough, and help you solve your problem, not sweep it under the rug.