Trouble Shooting
-
-
error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.Trouble Shooting 2023. 1. 10. 19:16
Do it! C언어 입문 책을 학습하던 중, 270페이지의 두번째 예제 (두 개의 문자열 합치기)를 진행하다가 이러한 오류가 발생했다. strcpy와 strcat가 안전하지 않으니 대신해서 strcpy_s, strcat_s를 사용하거나 _CRT_SECURE_NO_WARNINGS를 입력하라고 한다. // 두 개의 문자열 합치기 (strcpy, strcat) #define _CRT_SECURE_NO_WARNINGS // c4996오류 해결을 위해 입력함 #include #include void main() { char data[10] = "abc"; char result[16]; strcpy(result, data); strcat(result, "def"); printf("%s + \"def\" = %s\n..