- #include <stdio.h>
- #include <iostream>
- using namespace std;
- int main(){
- long a=113;
- char temp[2];
- temp[0] = (char)a;
- temp[1] = '\\0';
- char *str="abcd";
- unsigned char c = str[0];
- int d = (int)c;
- cout<<temp<<';'<<d<<endl;
- system("pause");
- }
- //该片段来自于http://www.codesnippet.cn/detail/3010201410845.html
来源: http://www.codesnippet.cn/detail/3010201410845.html