error C2296: “&”: 非法,左操作数包含“const char [6]”类型
代码如下#include<stdio.h>
void display(char ch,int height,int width);
int main(void)
{
char ch;
int height,width;
printf("Please enter a character and two integers\n");
while((ch=getchar())!='\n')
{
char ch2;
if(scanf("%d%d\n"&height,&width)!=2)
break;
display(ch,height,width);
while((ch2=getchar())!='\n')
continue;
printf("Please enter another character and two integers\n");
printf("Enter a new line to quit\n");
}
printf("Bye\n");
return 0;
}
void display(char ch,int height,int width)
{
int lines,rows;
for(lines=1;lines<=height;lines++)
{
for(rows=1;rows<=width;rows++)
printf("%5c\n",ch);
}
}
红字为报错部分
error C2296: “&”: 非法,左操作数包含“const char [6]”类型
什么意思??