Std in Xcode

  • Thread starter 00PS
  • Start date
  • #1
30
0

Main Question or Discussion Point

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.
 

Answers and Replies

  • #2
jtbell
Mentor
15,584
3,561
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!
 
  • #3
30
0
thanks for the help!

namespace was not a concept i remember from my programming classes so it was nice to learn something new. :)
 

Related Threads on Std in Xcode

  • Last Post
Replies
12
Views
8K
  • Last Post
Replies
0
Views
531
  • Last Post
Replies
5
Views
9K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
6
Views
5K
  • Last Post
Replies
7
Views
5K
  • Last Post
Replies
9
Views
679
  • Last Post
Replies
2
Views
4K
Replies
4
Views
3K
Replies
9
Views
2K
Top