int Myfunc2(int array[])
{
//however the length of array is different in 2 compiler here.
//it is a zero terminated array. but when passed into Myfunc2, array's second
//elements becomes 0;
do_something(array);
}
struct A
{
int a;
int b[5];
};
int Myfunc1()
{
struct A st;
Init(&st);
Myfunc2((&st)->b);
}
Myfunc2使用p指向的数组中的第二个元素。C问题:2编译器之间的差异
在visual studio中,它是一个以原始大小传递的数组。而在海湾合作委员会的阵列是 大小1.哪一个是正确的?
咦?你能解释一下吗? – 2011-01-21 15:39:07
是的,请澄清。 – 2011-01-21 15:43:39