I get these error messages for all cout
and endl
:
main.cc:17:5: error: ‘cout’ was not declared in this scope
main.cc:17:5: note: sugges
You probably had using namespace std;
before in your code you did in class. That explicitly tells the precompiler to look for the symbols in std
, which means you don't need to std::
. Though it is good practice to std::cout
instead of cout
so you explicitly invoke std::cout
every time. That way if you are using another library that redefines cout
, you still have the std::cout
behavior instead of some other custom behavior.