为什么字符变量的声明语句一定要放在输出函数的前面,不然就出错
main(void)
{
printf("input many characters:\n");
char ch; /*声明语句放在这出错,为expression syntax.*/
ch=getchar();
printf("%c\n",ch);
}
改为:
main(void)
{
char ch;
printf("input many characters:\n");
ch=getchar();
printf("%c\n",ch);
}
就无错了.为什么???