Thread: C++ Programming
View Single Post
Old 03-09-2005, 01:06 PM   #2 (permalink)
Iron_Cross
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

It saves typing...Take the hello world application for example:

With using namespace std;
Code:
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello World";
    cout << endl;
    return 0;
}
Without using namespace std;
Code:
#include <iostream>
int main()
{
    std::cout << "Hello World!";
    std::cout << endl;
    return 0;
}
In a small application like that typeing std:: doesn't make too much difference, but in a large application typing all the namespaces can be a pain in the butt! So when you include a using statement, you no longer have to include the fully quallified name.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline