I have a problem when I compile my C code under Linux. I'm using Linux Mandrake 7.2 (Odyssey) but I forgot the kernel version (sorry..), and I try to make a program that have a multiple choice. I have using C for a long time but I used it in DOS environment. When I move to C under Linux, I think that it will be similar. Yes, it really similar, but programming in Linux is quite hard. When I want to make a multiple choice in C under DOS, I use switch() function. And it works. But when I use switch() function in C under Linux, and I compile it, it says: "Segmentation Fault" and it refers to the line contains switch() function. How can I correct this error?
Comments
:
:
C-standard is same in DOS and Linux and on all other platforms. There must be something wrong with your switch statement.
btw. switch isn't a function, it reserved word in C.
Good luck