But it does process one character at a time. Type any character and press enter. Then run it with a different length input. The only difference is when you press enter. Your experiment results mean that stdin is line buffered. In other words, scanf will read until a whole line is in stdin and then only return the first character. Subsequent calls to scanf will be streamed from stdin, until after the '\n' character is encountered.