关于指向数组的指针初始化的问题,谢谢帮忙
VC++6.0下编译#include <stdio.h>
int main(void)
{
int (*fp)[10];
int num[10];
fp = num;//这里错在哪呢?
return 0;
}
编译器提示:
--------------------Configuration: Cpp2 - Win32 Debug--------------------
Compiling...
Cpp2.cpp
D:\c\Cpp2.cpp(6) : error C2440: '=' : cannot convert from 'int [10]' to 'int (*)[10]'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.
Cpp2.obj - 1 error(s), 0 warning(s)