下面的代码在VC++6.0可以正常运行输出,但是放在VS2013(scanf()在VS2013里已经改为scanf_s())就不行,不懂是为什么
#include <stdio.h>int main()
{
char letter;
printf("Enter an upper case letter:");
scanf("%c",&letter);
if ((letter >= 'A') && (letter <= 'Z'))
{
letter = letter + 'a' - 'A';//等价于l=l+'a'-'A'
printf("You entered an uppercase %c.\n", letter);
}
else
printf("You did not erter an uppercase letter.\n");
return 0;
}