I am learning C and I\'m using \"getchar()\" to stop the command windows so I can see the exercises am doing but it just doesn\'t work. heres a sample:
Your scanf only ate the number but not the trailing newline. Putting a newline or white space after the %d will then give you the opposite problem, reading too far.
This is why people don't like scanf.
I would suggest reading an actual line (use fgets(3)) and then using sscanf() to scan the string.