scanf ignore

    scanf속에 표현식을 넣는 경우, scanf가 무시될 수 있다.

    제목에 적은대로scanf에 %s나 %d가 아닌,%[^\n]s%d %d,등으로 설정한 경우, 입력버퍼에 위 경우가 존재하지 않으면 scanf가 실행되지 않습니다. #include int main(void) { int a, b; printf("\n>>"); scanf("%d %d\n", &a, &b); printf("[%d,%d]\n>>", a, b); scanf("%d %d\n", &a, &b); printf("[%d,%d]\n>>", a, b); return 0; } ( Reference : http://electro-don.tistory.com/entry/scanf-n-%EA%B4%80%EB%A0%A8 )