SyntaxFix
Write A Post
Hire A Developer
Questions
Everything in the Standard Template/Iostream Library resides in namespace std. You've probably used:
using namespace std;
In your classes, and that's why it worked.