首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > windows >

数组怎么申明

2011-12-31 
数组如何申明?#include windows.h#pragma comment(linker, /OPT:NOWIN98)#pragma comment( linker, /

数组如何申明?
#include <windows.h>
#pragma comment(linker, "/OPT:NOWIN98")
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
void main()
{
unsigned char PIShellCode[n] =
{
/数组
};

_asm
{
lea eax,_black
call eax
}
}

编译失败..
--------------------Configuration: Cpp4 - Win32 Debug--------------------
Compiling...
Cpp4.cpp
f:\cpp4.cpp(7) : error C2065: 'n' : undeclared identifier
f:\cpp4.cpp(7) : error C2057: expected constant expression
f:\cpp4.cpp(7) : error C2466: cannot allocate an array of constant size 0
执行 cl.exe 时出错.

Cpp4.obj - 1 error(s), 0 warning(s)

请问为什么会这样?

[解决办法]
接分了,
楼上说得对,
还有问错地方了,好像
[解决办法]

探讨

f:\cpp4.cpp(7) : error C2065: 'n' : undeclared identifier

这一句不是说得很清楚了,c\c++中声明数组时需要指定固定长度,这里的n没有定义啥,谁知道楼主这个n是多长,数组初始化时要分配多少空间

热点排行