关于static char[]的初始化问题。
关于static char[]的初始化问题。
在windows程序设计中看到了这种用法,感觉有些奇怪,请大家帮忙解释一下
(具体位置在上册218页函数
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
中的第7行)。
具体例子是:
#include <stdio.h>
#include <string.h>
int main()
{
static char szTop[] = "this" "is" "a" "test"; //这是什么意思呢?
printf("%s\t%d.\n", szTop, strlen(szTop));
return 0;
}
/*
结果:thisisatest 11.
*/