User forums > Help
Can't Open Code::Blocks (Windows 8.1 machine)
thomas:
Yes, there are several things wrong. First, this is not a general C programming forum, so it's the wrong place to ask why your code does not compile.
Second, you're using invalid syntax in your #define, third you're missing a closing brace for the second printf.
As a side note, learning C++ but starting with C for now is an approach that is discouraged. C and C++ are different languages. While it is perfectly acceptable to learn C (and later C++), experts recommend that if you plan to learn C++ that you start with that right away.
oBFusCATed:
And forth: Visual studio C++ (cl.exe) is the wrong compiler to use, because it is not a C, but C++ compiler.
DragonOsman2:
Alright, I get all that. I'm only going to bother you guys with hopefully just one question before I move on to C++ (after I'm done with C, I mean).
I get this error when trying to use the getc() function in my code: main.c|9|error C2198: 'getc' : too few arguments for call|
The source code is:
--- Quote ---#include <stdio.h>
int main()
{
int c;
int getc();
printf("I'm waiting for the character: ");
c = getc();
printf("I waited for the '%d' character\n",c);
return 0;
}
--- End quote ---
Anything you can help me with here?
Jenna:
Please respect our forum rules !!
--- Quote from: thomas on December 05, 2013, 12:35:06 pm ---Yes, there are several things wrong. First, this is not a general C programming forum, so it's the wrong place to ask why your code does not compile.
--- End quote ---
And you should learn to search for documentation yourself, for C/C++ functions a site like cppreference.com is not the worst choice.
For your special question:
http://en.cppreference.com/w/c/io/fgetc
Navigation
[0] Message Index
[*] Previous page
Go to full version