Quote Originally Posted by Arzakon12589 View Post
Hello,

So are you saying that when the printf prompt comes up, asking me my name and I type in John Doe and hit Enter, the computer is essentially doing the following:

%s = John
1st %d = ' ' (a blank space)
2nd %d = Doe

and therefore nothing else in the code executes because it already has the input from my first entry it just doesn't make any sense?
First of all, you do not initialize the local variables, "name", "DOB", and "phoneNumber". They contain whatever garbage values are in the variables when the program starts.

Initialize ALL local variables!

Yes, the first scanf() inputs one word, John.

The second scanf() ignores the space and attempts to convert "Doe" to an int, and fails, leaving the text in the input buffer, and assigns nothing to DOB, and leaves whatever garbage value was in DOB when called.

The third scanf() also attempts to convert "Doe" to an int and fails, as with the second scanf().

Within a while loop, if you capture the return value from scanf(), you will see when the scanf() fails. You can clear the input buffer, but NOT with fflush(stdin)!!! fflush() is only for use with output buffers. You then can prompt the user for the value again, until you get the correct value.

You need to study a good up to date book on the C Programming Language! Please see my other post, here.

You need to read the scanf manpage for more information, or run "man scanf" on a Linux system.