在pascal 或c++中, 如何将读入的中文转化为代码,以便进行处理?

来源:百度知道 编辑:UC知道 时间:2024/05/16 20:03:48

如果是file 读取
ifstream infile;
infile.open("xxxx.xxx"); //open file
char ch,ch2;
infile.get(ch); //将第一个字节存入ch
infile.get(ch2); //将第二个字节存入ch2
//这样一个中文字符就被拆开成了两个ASCII码分别存入了ch 和ch2。

如果是直接输入也是一样的。