主题:[讨论]数组指针传递疑问?!!!
请教以下程序调用的问题所在
主程序
//定义数组
unsigned char * aValue[4];
//调用子程,接收子程传递的指针值
aValue = GetArray();
子程序
unsigned char WINAPI GetArray()
{
//定义数组
unsigned char * TempArray[4];
------------
------------
------------
//返回数组指针
return TempArray;
}
错误
error C2440: '=' : cannot convert from 'unsigned char *[4]' to 'unsigned char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2440: '=' : cannot convert from 'unsigned char' to 'unsigned char *[4]'
There are no conversions to array types, although there are conversions to references or pointers to arrays
主程序
//定义数组
unsigned char * aValue[4];
//调用子程,接收子程传递的指针值
aValue = GetArray();
子程序
unsigned char WINAPI GetArray()
{
//定义数组
unsigned char * TempArray[4];
------------
------------
------------
//返回数组指针
return TempArray;
}
错误
error C2440: '=' : cannot convert from 'unsigned char *[4]' to 'unsigned char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2440: '=' : cannot convert from 'unsigned char' to 'unsigned char *[4]'
There are no conversions to array types, although there are conversions to references or pointers to arrays