C/C++中,字符序列(常量)赋值给整型变量

//在VS2008中的执行结果
int i = '1';  //i = 0x31
int i = '12';  //i = 0x3132
int i = '123';  //i = 0x313233
int i = '1234';  //i = 0x31323334

5个及以上字符时,报错

 error C2015: 常量中的字符太多

原文地址:https://www.cnblogs.com/custa/p/1948497.html