![]() |
|
#1
|
|||
|
|||
Newbie : need help with Dev-C++ compilerHi !
I am newbie trying to learn to code in C and I recently installed the Dev-C++ compiler I had a few questions about the compiler : I tried to use some C++ syntax and the compiler gave me an error, in the documentation i read that the MiniGW which is the compiler system used gcc for C compiling and g++ for C++ compiling The code is listed as follows : CPP / C++ / C Code:
The error I received was this : Quote:
Here are the questions that popped up : "Does the dev-C++ compiler compile only C code , if not how can I make it do only that if possible ????? " Iam looking for a C compiler that compiles on C code and not C++, I was using visual C++ before to compile before, the problem with VC++ is that it allows you to mix C and C++ code and doesn't complain about. It is also my fault to a great extent since I am trying to correct my programming style by being able to write code which is specific to C or C++ so any help with a C compiler would be appreciated. I am running windows XP Last edited by LuciWiz : 04-Mar-2005 at 00:13.
Reason: Plese insert your C++ code between [c++] & [/c++] tags
|
|
#2
|
|||
|
|||
|
I'm not an expert at C++, but I think if you include iostream without the .h extension, you have to use std::cout or declare 'using namespace std' before you use any i/o operators.
|
|
#3
|
|||
|
|||
|
Dr. Evil is right. cout and cin and endl and everything in the standard headers is defined within the std namespace, so you have to include "usng namespace std;" (no quotes) to use them. alternatively, access them by std::cout etc.
|
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with borland compiler | Mjkramer21 | CPP / C++ Forum | 2 | 08-Jul-2005 19:53 |
| 32 bit compiler needed | meet_raman | CPP / C++ Forum | 2 | 24-Jun-2004 03:42 |
| newbie using Sam's series | Skampy | CPP / C++ Forum | 3 | 06-Mar-2004 18:51 |
| a noobish compiler question | Charunks | CPP / C++ Forum | 5 | 03-Sep-2003 02:18 |
| i need a free Mac compiler | yerdos | CPP / C++ Forum | 1 | 28-Jul-2003 02:12 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The