• 카테고리

    질문 & 답변
  • 세부 분야

    프로그래밍 언어

  • 해결 여부

    미해결

C4996 'getch': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _getch. See online help for details. Project3 C:\Users\개인정보\source\repos\Project3\Project3\소스.c

21.01.31 12:27 작성 조회수 127

0

#define _CRT_SECURE_NO_WARNINGS

#include <conio.h>

#include <string.h>

#include <stdio.h>

#define MAX 10000

int main(void)

{

char line[MAX];

char contents[MAX];

char password[20];

char c;//마스킹

printf("비밀일기장에 오신 것을 환영합니다\n");

printf("비밀번호를 입력하세요 : ");

int i = 0;

while (1)

{

c = getch();

if (c == 13)//Enter

{

password[i] = '\0';

break;

}

else

{

printf("*");

password[i] = c;

i++;

}

}

printf("\n\n == 비밀 번호 확인 중...====\n\n");

if (strcmp(password, "skehzheld") == 0)

{

printf("비밀번호 확인 완료\n\n");

char* fileName = "C:\\Users\\개인정보\\OneDrive\\바탕 화면\\text.txt";

FILE* file = fopen(fileName, "a+b");

if (file == NULL)

{

printf("파일 열기 실패");

return 1;

while (fgets(line, MAX, file) != NULL)

{

printf("%s",line);

}

printf("\n\n 내용을 계속 작성하세요 ! 종료하시려면 EXIT를 입력하세요\n\n");

while (1)

{

scanf("%[^\n]", contents);

getchar();

if (strcmp(contents, "EXIT") == 0)

{

printf("비밀일기 입력을 종료 합니다\n\n");

break;

}

fputs(contents, file);

fputs("\n", file);

}

fclose(file);

}

else

{

printf("비밀 번호가 틀렸어요");

}

return 0;

}

라고 적었더니 오류가

'getch': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _getch. See online help for details.라 뜨네요 하지만 이상한 것은 빨간 밑줄이 뜨지 않으나 오류로 인식이 되어 있네요ㅠㅠ 계속 비교해도 뭐가 문제인지 모르겠어요ㅠㅠ

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!