Hello guys, a little newbie here. Can't figure out why it flows two times. Thanks!
Hello guys, a little newbie here. Can't figure out why it flows two times. Thanks!
When you press a letter, then 'enter', two characters are being sent to the program - the letter you entered and the newline character. The first time through, "scanf()" reads the letter you entered. The next time through, it picks up the newline from the input buffer.
More information, and some solutions, can be found here -> FAQ > How do I avoid a "dangling" newline when reading single character user input? - Cprogramming.com
Well...worked. Many thanks!