初学者,输出还像错了。多了个“N"~求解!
#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 << " Done !" << endl;
return 0;
}
为什么得出来是:
The ASCⅡ code for M is 77
Add one to the character code;
The ASCⅡ code for N is 78;
N Displaying char ch using cout.put(ch):0047CE94
Done!
不是应该这样吗?:
The ASCⅡ code for M is 77
Add one to the character code;
The ASCⅡ code for N is 78;
Displaying char ch using cout.put(ch):0047CE94
Done!
怎么在Displaying前面会出现一个“N”??
[ 本帖最后由 Cai_xw1993 于 2012-5-3 22:00 编辑 ]