News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Can't Open Code::Blocks (Windows 8.1 machine)

Started by DragonOsman2, December 04, 2013, 04:54:30 PM

Previous topic - Next topic

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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

oBFusCATed

And forth: Visual studio C++ (cl.exe) is the wrong compiler to use, because it is not a C, but C++ compiler.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

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;
}


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.
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