I think you made on of the most known mistakes. Try to always put a
getchar(); after your scanf to get the return when the user presses the
keyboard key. Otherwise the input will be scanned with scanf, but the return
will be scanned with whatever other scan function that follows somewhere in
your code and that function will be over.
--
http://www.sin.khk.be/~emulov/index_english.htm
computer-internet-programming-HTML-programupload
--
READ THIS: Anything I say I say for myself, I DON'T
want ANY nagging afterwards!!!!
:I continue to run into the following problem;
:
:I need to get user input multiple times, once in the beginning of the
:code and again after a do/while/for loop and MY method and thinking
:doesn't work as expected.
:
:what usually happens(with my P... poor code) is the user is
:prompted(printf/scanf) for input, the code continues into the
:do/while/for loop and the section of code that prompts the user is
:bypassed (as if a value has already been passed to it's scanf) and any
:expressions/functions/tests are performed (the ones within the loop)
:once, where at that point the user is finally prompted for input.
:What am I missing ? Here's a simple .c the shows what I'm talking about.
:Why is the (second(/*remarked*/))printf/scanf skipped the first time
:thru ?
:...and/or what's a better technique for multiple prompting ?
:
:yes, I'm new to this.
:
:#include <stdio.h>
:
:static int count = 0;