std:cout: A namespace is a declarative region inside which something is defined. So, in that case, cout is defined in the std namespace.
How can we use cout with and without using 'std::'? cout and std::cout both are same, but the only difference is that if we use cout, namespace std must be used in the program or if you are not using std namespace then you should use std::cout.
The cout object in C++ is an object of class ostream. It is defined in iostream header file. It is used to display the output to the standard output device i.e. monitor. It is associated with the standard C output stream stdout.
cout is a global object defined in the std namespace, and endl is a (stream manipulator) function also defined in the std namespace.
add #include <iostream>
to the start of io.cpp
too.
Also remember that it must be:
#include "stdafx.h"
#include <iostream>
and not the other way around
#include <iostream>
#include "stdafx.h"
I had a similar issue and it turned out that i had to add an extra entry in cmake
to include the files.
Since i was also using the zmq library I had to add this to the included libraries as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With