Tuesday, April 26, 2011

todTest.cpp

#include
#include
using namespace std;
struct tod
{
int hour;
int minute;
int second;
}; // tod
void printTod(tod& t)
{
cout.fill('0');
cout << setw(2) << t.hour << ':'
<< setw(2) << t.minute << ':'
<< setw(2) << t.second << endl;
cout.fill(' '); // set back to a space
}
int main()
{
tod noon = {12};
printTod(noon);
return 0;
} // main

0 comments:

Sponsored By