请问怎样判断输入数组为空?
怎样判断输入数组为空?谢谢!
如下对吗?
printf("\n\n\nPlease input a[8] :");
for(i=0;i<8;i++)
scanf("%1d",&a[i]);
printf("\n\nPlease input k[10] :");
for(i=0;i<10;i++)
scanf("%1d",&k[i]);
if(a[i]=='\0' || a[i]=='\n' || k[i]=='\0' || k[i]=='\n')
{
printf("Error!\n");
}
else
{
...
}
请问这样判断有错么?