Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Std in Xcode

  1. Sep 24, 2008 #1
    std:: was not used in my previous experiences with programming in C/C++ but in xcode,it requires you to put 'std::' in front of both cout and cin. i get an error that reads 'cout' was not declared in scope. im sure it is something very trivial but in insights would be appreciated.
  2. jcsd
  3. Sep 25, 2008 #2


    User Avatar

    Staff: Mentor

    C++ has the concept of "namespaces". In standard C++, all functions and global variables must be declared within some namespace. I hope you'll forgive me for not taking the time to write a long tutorial on namespaces when there is a lot of material about namespaces available already, for example with a Google search on "C++ namespaces".

    After doing some reading, if you have specific questions, please feel free to ask here!
  4. Sep 25, 2008 #3
    thanks for the help!

    namespace was not a concept i remember from my programming classes so it was nice to learn something new. :)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Std in Xcode
  1. Xcode help (Replies: 6)