VisualStudio安装
error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
cpp
#include <stdio.h>
int main() {
printf("hello");
int a = 0;
scanf("%d", &a);
printf("%d\n", a);
return 0;
}
解决方案:
cpp
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
printf("hello");
int a = 0;
scanf("%d", &a);
printf("%d\n", a);
return 0;
}
vcpkg安装
vcpkg有自动集成到Visual Studio的命令。
示例下载plibsys: