You must Prefix the std elements with the (::) scope resolution operator, for example:
1 2
std::cout
std::endl
there are other ways however to access the elements of the std.
you could do this outside of the main() function:
1 2
using std::cout;
using std::endl;
- by declaring exactly which elements from the std namespace you want local to your program, you're able to access them directly without prefixing them during the life of your program.
You could also employ the "using" directive as mentioned by Niven: