Thread: Dev-cpp compiler goes wrong ?

  1. #1
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    Dev-cpp compiler goes wrong ?

    i download dev-cpp 5 (beta version) and have a simple test like this:
    PHP Code:
    #include <iostream>

    int main ()
    {
      
    cout << "Hello World!";
      return 
    0;

    what shocked me was the code above refused to work unless i rewrite the first line to this: #include <iostream.h>, too strange i remembered C++ compiler could recognize preprocessor whithout .h extension, what's happened ???
    Never end on learning~

  2. #2
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    you can neglect the .h but the you need to put a 'using namespace std' or a std::-prefix before the functions.

    /btq
    ...viewlexx - julie lexx

  3. #3
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    Originally posted by btq
    you can neglect the .h but the you need to put a 'using namespace std' or a std::-prefix before the functions.

    /btq
    thanx. i just got that code worked nicely in my older version of Dev-C++, and the new one report and error when i do that code again, this is probably new feature but i didnt notice something about it
    Never end on learning~

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev C++ compiler question
    By calsonicgtr in forum C Programming
    Replies: 2
    Last Post: 09-01-2008, 10:36 PM
  2. Weird compiler (Dev)
    By gavra in forum C Programming
    Replies: 11
    Last Post: 08-03-2008, 01:19 AM
  3. includein cpp file in a cpp file
    By sawer in forum C++ Programming
    Replies: 7
    Last Post: 06-15-2006, 12:34 PM
  4. Dev C++ help please!!!
    By caroundw5h in forum C Programming
    Replies: 7
    Last Post: 11-27-2003, 09:48 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM