Checked the FAQ for a solution - no help.
I'm using MS visual C++ 6.0. Teaching myself C++.
Tried to convert a C program. Ran into a problem with a
printf statement. Can't convert it to a cout.
Thanks in advance for any suggestions. Here is the code:
[edit]Code tags added by Hammer.Code:#include <iostream> using namespace std; int main() { char ch, ans; ch = 'Y'; cout <<"ROUTINE TO CONVERT A CHARACTER TO ITS ASCII VALUE"; cout << endl <<endl <<endl; while (ch == 'Y' || ch == 'y') { cout <<"Enter a character :"; cin >> ans; cout << endl; printf("The ASCII value of %c is %d\n",ans,ans); cout << endl <<endl; ch = 'x'; while (ch != 'Y' && ch != 'y' && ch != 'N' && ch != 'n') { cout << endl <<endl; cout <<" ANOTHER (Y/N ? : "; cin >> ch; } } return 0; }



LinkBack URL
About LinkBacks


