using namespace std; question.

This is a discussion on using namespace std; question. within the C++ Programming forums, part of the General Programming Boards category; What is Code: using namespace std; and should I use it?...

  1. #1
    fuh
    fuh is offline
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176

    Unhappy using namespace std; question.

    What is
    Code:
    using namespace std;
    and should I use it?
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

  2. #2
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    It makes the namespace for the block that follows...
    You can use it like this:
    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
         cout << "Hi" << endl;
         return 0;
    }
    so you don't need to use std::cout, and std::endl; each time in your program...
    none...

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Check this out

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Thoughts about using namespace std?
    By dwks in forum C++ Programming
    Replies: 40
    Last Post: 09-25-2008, 05:14 PM
  2. namespace std - After searching the the boards
    By jrahhali in forum C++ Programming
    Replies: 11
    Last Post: 08-26-2004, 04:51 AM
  3. namespace std
    By strobe9 in forum C++ Programming
    Replies: 5
    Last Post: 10-21-2003, 08:09 PM
  4. *sigh* Using Namespace Std; Woes
    By KneeLess in forum C++ Programming
    Replies: 4
    Last Post: 10-06-2003, 04:41 PM
  5. Namespace std
    By Nubi in forum C++ Programming
    Replies: 4
    Last Post: 06-01-2003, 08:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21