Hi, guys, and thanks in advance for helping me with this. I'm following a tutorial online about introductory C programming and there's a video on functions. Now I copied exactly what the guy said but, inexplicably, I'm getting an error message! Now the only difference is that he's using code blocks 13.01 and I'm using 16.01. I have no idea what I'm doing wrong!?? The exact code is:
#include <stdio.h>
#include <stdlib.h>
void MyFunctionName();
int main()
{
MyFunctionName();
}
void MyFunctionName();
{
printf("sum=%d\n", 10+52);
prinf("We are inside a function\n");
}
The error message stops next to the third curly bracket and the error message is as follows: error: expected identifier or '(' before '{' token
Now this must be some kind of very solution but what could I possibly be doing wrong??
1) This is not a generally programming forum, but a forum for codeblocks... Your problem is only a programming error and has nothing to do with codeblocks. So this will probably get locked by a admin and you will get a reprimand
2) If you post code, please use code tags (the # symbol in the post editor)
3) http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
QuoteThe error message stops next to the third curly bracket and the error message is as follows: error: expected identifier or '(' before '{' token
look at your code.... what is previous the third curly bracket (this should have a line number.....) ? What is there what shouldn't be there....[/size]
greetings
I don't understand your statement bluehazard. The 3rd curly bracket that I'm talking about is on line 13 and the whole program has 15 lines. Thanks for the posting tip, btw.
Please read and follow the rules http://forums.next.codeblocks.org/index.php/topic,9996.0.html (http://forums.next.codeblocks.org/index.php/topic,9996.0.html)
Tim S.