新手学习scanf函数的问题,求大神帮忙解决.....
代码如下:#include<stdio.h>
int main(void)
{
char ch;
printf("Please enter a character.\n");
scanf_s("%c", &ch);
printf("The code for %c is %d.\n", ch, ch);
system("pause.\n");
return 0;
}
输入一个ASCII Code后输出结果却是错误的,如下:错误应该是printf无法调取%c这个常量,求解决办法
Please enter a character.
c
The code for ?is -52.
请按任意键继续. . .