我有这个代码:
int* read(){
int i,num,array[11];
printf("enter a integer value between 1 & 10: ");
scanf("%i",&num);
while(!(num>0&&num<11)){
read() ;
}
if(num>0&&num<11){
printf("enter %i integers now: ",num);
for(i=0;i<num;i++)
scanf("%i",*array++);//LINE 19 is here..........
*array=0;
}
return array;
}
当我尝试调用此函数时,它显示以下编译器错误:
[Error] C:\Users\seeker-PC\Documents\C-Free\Projects\n\Untitled12.cpp:19: error: ISO C++ forbids cast to non-reference type used as lvalue
[Error] C:\Users\seeker-PC\Documents\C-Free\Projects\n\Untitled12.cpp:19: error: non-lvalue in assignment
你能解释一下出了什么问题吗?