Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Can't compile, Tried 2 types of compilers

views
     
silverhawk
post Feb 1 2006, 11:01 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


you can include the standard libraries with or without the .h, the difference is in the namespace.

for example
CODE

#include <iostream.h>

void main()
{
    cout << "Hello World" << endl;
}


CODE

#include <iostream>

void main()
{
    std::cout << "Hello World" << std::endl;
}


or a better way... this way you do not need to append the namespace everytime you call a function or something.

CODE

#include <iostream>

using std::cout;
using std::endl;

void main()
{
    cout << "Hello World" << endl;
}


 

Change to:
| Lo-Fi Version
0.0158sec    0.37    6 queries    GZIP Disabled
Time is now: 24th December 2025 - 09:32 AM