#include <iostream>
using namespace std;
int main ()
{
char ch = 'M';
int i = ch;
cout << "The ASCⅡ code for " << ch << " is "<< i << endl;
cout << "Add one to the character code;"<< endl;
ch = ch + 1;
i = ch;
cout << "The ASCⅡ code for " << ch << " is " << i << endl;
cout << " Displaying char ch using cout.put(ch): ";
cout.put(ch) << endl; //而cout << cout.put(ch) << endl; 在输出N的同时也会输出ch的地址。
cout << " Done !" << endl;
return 0;
}
using namespace std;
int main ()
{
char ch = 'M';
int i = ch;
cout << "The ASCⅡ code for " << ch << " is "<< i << endl;
cout << "Add one to the character code;"<< endl;
ch = ch + 1;
i = ch;
cout << "The ASCⅡ code for " << ch << " is " << i << endl;
cout << " Displaying char ch using cout.put(ch): ";
cout.put(ch) << endl; //而cout << cout.put(ch) << endl; 在输出N的同时也会输出ch的地址。
cout << " Done !" << endl;
return 0;
}