vs2017 community
win10
代码:
#include <stdio.h>
int main() {
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
}
错误:
C4996 ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
解决方法1:
scanf -> scanf_s
解决方法2:
_CRT_SECURE_NO_WARNINGS