紧急问题:Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
本程序的目的是为了让此C程序 在VC里编译通过运行
对于b[][] vc编译一直提示出错。。。。。。。。。
请帮忙 谢谢
// temp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int convert(int b[]);
int main(int argc, char* argv[])
{
int a[3][6];
a[0][0] = 1;
a[0][1] = 2;
a[0][2] = 3;
a[1][0] = 4;
a[1][1] = 5;
a[1][2] = 6;
a[2][0] = 7;
a[2][1] = 8;
a[2][2] = 9;
convert( a );
return 0;
}
int convert(int b[])
{
int i,j;
int num;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
num = b[i*3+j];
printf("hello %d\n",num);
}
return 1;
}
错误提示::\My Documents\zej\temp\temp.cpp(22) : error C2664: 'convert' : cannot convert parameter 1 from 'int [3][6]' to 'int []'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.