I'm having a weird problem
i'm trying to read a string from a console with scanf()
Trying to use
scanf to read strings with spaces can bring unnecessary problems of buffer overflow and stray newlines staying in the input buffer to be read later.
gets() is often suggested as a solution to this, however,
From the manpage:
Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead.
So instead of using
fgets with the STDIN stream to read strings from the keyboard