
输入任意一个字母,转换成对应的ASCII码数据值,为什么不能用'letter',但是用'A'就可以得到数据,怎样用letter表示任意值?

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cin >> noskipws;
char ch;
while (cin >> ch)
{
if (isprint(ch))
cout << ' ' << ch;
else
cout << '^' << static_cast<char>('@' + ch);
cout << setw(4) << static_cast<int>(ch) << endl;
}
return 0;
}
ASCII Caret Notation
https://en.wikipedia.org/wiki/ASCII#Control_code_chart