如何创建一个包含ASCII 127单个字符的char或string常量?
// Normal printing character - no problems
const char VPIPE = '|';
//error "The expression being assigned to 'DEL' must be constant"
const char DEL = new string(127, 1);
如果常量是字符串而不是字符,也可以:
const string VPIPE = "|";
const string DEL = "???";
我知道ASCII 127不是你可以在键盘上“输入”的内容,但一定有方法可以从中创建字符串或字符常量(或使用我尚未找到的内置常量)。