문자

    엔터(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..

    android studio, Failed to set EGL_SWAP_BEHAVIOR on surface

    Failed to set EGL_SWAP_BEHAVIOR on surface 에러를 만났다. 화면이 안나온다. 고민고민 하다가 아래 글을 보았다.http://openclassrooms.com/forum/sujet/android-runtimeexception 그래서 방법을 찾았다.화면이 맞지 않는 것이였다. 그래서 setContentView(R.layout.activity_my); 을 변경하였더니 잘 작동 되었다.