July 19th, 2013, 11:17 PM
Using ";" in my functions
void nothing(int a, int b; int c, int d);
In here, I get an error about the ";" inside the brackets. Why can't I do that just like the for loop statement?
July 19th, 2013, 11:44 PM
Because the C syntax doesn't define it that way. The ; is a code statement terminator, not a statement separator.
Want to argue about it, take it up with Ken Thompson and Dennis Ritchie.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
July 20th, 2013, 02:49 AM
Processing your source with bash command
tr \; , < program.c.pre > program.c
before submission to the compiler will fix this problem.
Comments on this post
[/code] are essential for python code and Makefiles!
July 22nd, 2013, 09:30 AM
because for loop has three statements that are combined in one line and to seperate them the c compiler supports ; to seperate them.but a function prototype you use comma as a seperateor
July 23rd, 2013, 02:44 AM
it's same kind of question u have already asked.