Cout and endl errors

The compiler needs to know where to find std::cout first. You just need to include the correct header file:

#include <iostream>

I’d suggest you not to pollute the namespace using using directives. Instead either learn to prefix std classes/objects with std:: or use specific using directives:

using std::cout;
using std::endl;

Leave a Comment