💻 프로그래밍/C, C++

[C] C4996 'scanf': This function or variable may be unsafe.

gameuiux 2024. 4. 23. 06:52
728x90
반응형

⛔ 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.

 

Visual Studio에서는 보안상의 허점 방지를 위해

scanf 대신 scanf_s를 사용하는 것을 권장하고 있다.

 

해당 에러를 무시하고 컴파일 하려면

선행처리기 #pragma warning(disable: 4996)을 선언해주면 된다.

 

#include <stdio.h>
#pragma warning(disable:4996)

 

728x90
반응형