Author Topic: Can't Open Code::Blocks (Windows 8.1 machine)  (Read 23032 times)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #15 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.

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #16 on: December 05, 2013, 01:33:11 pm »
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!]

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #17 on: December 06, 2013, 09:08:19 pm »
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? 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't Open Code::Blocks (Windows 8.1 machine)
« Reply #18 on: December 06, 2013, 09:18:29 pm »
Please respect our forum rules !!
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