로딩
요청 처리 중입니다...

[c언어] 영한사전 프로그램

 [c언어] 영한사전 프로그램

입력된 단어가 사전에 있으면 뜻을 출력하고 그렇지 않으면 단어를 사전에 추가한다. 프로그램은 "quit" 를 입력할 때까지 계속 실행된다.

#include #include #include typedef struct { char word[20]; // 단어 구조체 char meaning[100]; // 단어 명 } wordType; // 단어 뜻 typedef struct { // 사전 구조체 wordType dict[5000]; // 5000개의 단어 구조체로 이루어진 배열 int count; //현재 단어 수 } dictType; //d가 가리키는 사전에서 w가 가리키는 단어를 찾아 meaning을 리턴 char* search(char* w, dictType* d) { int i; for (i = 0; i < d->count; i++) { // i가 0부터 count보다 작을 때까지 if (strcmp(d->dict[i].w...

# c언어사전 # c언어한영사전