Class and C2065 error

Hi


void clockType::printTime() const
{
if(hr < 10)
cout << "0";
cout << hr <<":";

if(min < 10)
cout << "0";//Gives me an error here for cout
cout << min <<":";//Gives me an error here too for cout.

if(sec < 10)
cout << "0";
cout << sec;
}


This function gives me the error C2065: 'cout' : undeclared identifier


Ehy is that???

I have the # inlcude <iostream> on the top.


Any help
You need std:: in front of it.
Topic archived. No new replies allowed.