VisualStudio不安全warning

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/sandalphon4869/article/details/100584333

当你使用scanf()、sprintf()的时候,会建议你使用scanf_s()、sprintf_s()。

你可以选择更改成sprintf_s(),或者让它不报错。

加上这个宏就ok。

#define _CRT_SECURE_NO_WARNINGS

比如:

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main() {
	printf("hello\n");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/sandalphon4869/article/details/100584333