Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ym1975 on October 29, 2016, 10:29:12 am

Title: Hi, Having trouble compiling!! Inexplicable error which shouldn't be.
Post by: ym1975 on October 29, 2016, 10:29:12 am
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??
Title: Re: Hi, Having trouble compiling!! Inexplicable error which shouldn't be.
Post by: BlueHazzard on October 29, 2016, 02:45:49 pm
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

Quote
The 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
Title: Re: Hi, Having trouble compiling!! Inexplicable error which shouldn't be.
Post by: ym1975 on October 29, 2016, 03:23:46 pm
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.
Title: Re: Hi, Having trouble compiling!! Inexplicable error which shouldn't be.
Post by: BlueHazzard on October 29, 2016, 04:02:12 pm
What is there what shouldn't be there
Title: Re: Hi, Having trouble compiling!! Inexplicable error which shouldn't be.
Post by: stahta01 on October 29, 2016, 04:05:14 pm
Please read and follow the rules http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

Tim S.