scanf()
always discards white spaces and new line characters. But when I give a character and press enter the new line character is read and stored. I'm unable to read required number of characters because of this. Is there any problem with my code, or some other thing?
The same problem goes with gets. Many posts suggested using fgets()
rather than using the above both but I need to know why is this happening.