scanf 출력오류
조회수 394회
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
printf("%d",n);
return 0;
}
코드에는 문제가 없는거같은데 계속 출력이 안되네요.
심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류 C4996 'scanf': This function or variable may be unsafe.
Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. S
ee online help for details.
이런 오류 뜨고 scanf_s
? 사용하면 출력창은 뜨는데 15라는 값이 떠야한다는데 아무것도 안떠요
도와주십시오. 선생님들.
1 답변
-
C4996 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. S ee online help for details. 구글번역 C4996 'scanf': 이 함수 또는 변수는 안전하지 않을 수 있습니다. 대신 scanf_s를 사용하는 것이 좋습니다. 지원 중단을 비활성화하려면 _CRT_SECURE_NO_WARNINGS를 사용하세요. NS 자세한 내용은 온라인 도움말을 참조하십시오.
scanf 를 사용하시고 싶으시면
#define _CRT_SECURE_NO_WARNINGS
정의해주세요https://docs.microsoft.com/en-US/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
scanf_s 는 scanf 와 다르게 파라미터가 하나 더 필요합니다.
Unlike scanf and wscanf, scanf_s and wscanf_s require you to specify buffer sizes for some parameters.
댓글 입력