Hi guys! ))
please reply - how to clear the input stream of the console?
thanks in advance ))
vedro-compota
33
Posting Whiz
Recommended Answers
Jump to PostRead characters until a newline or EOF is reached:
int ch; do ch = getchar(); while (ch != '\n' && ch != EOF);
This is the only portable method, but it also has a downside of blocking for input if the stream is already empty when the …
Jump to PostYou can signal EOF with a keyboard combination. On Windows it's Ctrl+Z, and on POSIX systems it's Ctrl+D.
All 6 Replies
Narue
5,707
Bad Cop
Team Colleague
vedro-compota
commented:
+++
+1
vedro-compota
33
Posting Whiz
Narue
5,707
Bad Cop
Team Colleague
vedro-compota
33
Posting Whiz
Narue
5,707
Bad Cop
Team Colleague
vedro-compota
33
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.