Hi,
I am wondering if there is a way (I'm sure there is) to display the following correctly:
I have a user enter a two digit number, say 01, 02,...45...
int id = 0;
cout << "Please enter #: ";
cin >> id;
cout << "#: " << id << endl;
If the number is 01 through 09 it only displays 1-9 without the preceding 0.
I've scoured my book that I have and used google a bit and I can't seem to find an answer.
Anyone know how to correct this?
Thanks from a c++ newb. 🙂
I am wondering if there is a way (I'm sure there is) to display the following correctly:
I have a user enter a two digit number, say 01, 02,...45...
int id = 0;
cout << "Please enter #: ";
cin >> id;
cout << "#: " << id << endl;
If the number is 01 through 09 it only displays 1-9 without the preceding 0.
I've scoured my book that I have and used google a bit and I can't seem to find an answer.
Anyone know how to correct this?
Thanks from a c++ newb. 🙂