fflush(stdin) <- 이거 왜 안되는거죠 -_-;;

wslee의 이미지

gcc나 윈도그 환경의 djgpp 컴파일러에서
fflush(stdin);

컴파일은 되는데
입력버퍼는 전혀 못비우던데

안되던데 -_-;;

익명 사용자의 이미지

아마 '당연히' 안 되는 듯합니다. (from manpages)

Quote:
The function fflush() forces a write of all user-space buffered data
for the given output or update stream via the stream’s underlying write
function. The open status of the stream is unaffected.

오병현 배상

IDNed의 이미지

eungkyu의 이미지

강조를 다른데 해줘야 더 명확하지 않을까요? ^^

Quote:
The function fflush() forces a write of all user-space buffered data
for the given output or update stream via the stream’s underlying write
function. The open status of the stream is unaffected.

stdin은 input stream이기때문에 fflush() 함수와는 관계가 없습니다.

Anonymous wrote:
아마 '당연히' 안 되는 듯합니다. (from manpages)

Quote:
The function fflush() forces a write of all user-space buffered data
for the given output or update stream via the stream’s underlying write
function. The open status of the stream is unaffected.

오병현 배상