int *p;
int *q;
void fun(int *a, int n, int *odd, int *even);
fun(a,n,p,q);
这样用为什么报错为:p和q没有初始化啊?
= =。你就写这么点代码,来问为什么错。也不知道你这全不全。如果只有这么多,报错,肯定是你的a,n没定义吧。编译通不过吧。
void fun(int *a, int n, int *odd, int *even)
{
}
int main()
{
int *a,*p,*q;
fun(a,20,p,q);
return 0;
}
要用指针的指针,或者引用(C++)
p和q没有初始化应该只是警告,你看看有没有别的提示