enter

    엔터(enter,개행문자) 입력받기.

    1. 개요 엔터 혹은 개행문자라 불리는 '\n'을 입력받아서 처리하는 코드를 작성해봤습니다. 2. 방법 방법은 2가지로 실험해봤습니다.1) gets2) getchar scanf는 엔터와 몇가지 아스키코드는 입력받지 않는 것으로 취급하기 때문에 논외로 하였습니다. 3. Source 1) gets #include int main() { char ch; gets(&ch); printf("%d\n", ch); if (ch == '\n') printf("Detecting Enter\n"); return 0; } 2) getchar #include int main() { int i; i = getchar(); printf("%d\n", i); if (i == '\n') printf("Detecting Enter\n..