MIL*_*ILO 0 c++ windows-console
我在一个据称微不足道的俄罗斯方块控制台游戏代码中发现了这一点。
wchar_t *screen = new wchar_t[];
unsigned char *pField;
.
.
.
screen[someMathIndex] = L" ABCDEFG=#"[pField[someOtherMathIndex]];
Run Code Online (Sandbox Code Playgroud)
方括号前面的 wchar 字符串是什么意思?我什至无法找到一种方法来谷歌它。你能不能把我重定向到这个奇怪的东西的一些资源。
C++ 中的字符串文字实际上是数组。我这个案例L" ABCDEFG=#"是一个const wchar_t[11]. 当你做
L" ABCDEFG=#"[pField[someOtherMathIndex]]
Run Code Online (Sandbox Code Playgroud)
您将转到该pField[someOtherMathIndex]wchar_t 数组的第 ' 个索引。