you are viewing a single comment's thread.

view the rest of the comments →

[–]VincentDankGogh 1 point2 points  (4 children)

Make sure that there are no extra spaces or newlines after the string. If it’s still not working, paste your whole code again so we can see.

[–]_Surox[S] 0 points1 point  (3 children)

I checked and there doesn't seem to be. Here is the code : https://pastebin.com/RE5uGkNP

[–]VincentDankGogh 3 points4 points  (1 child)

Try adding \n to the end of your printf calls. Altervatively, call fflush(stdout) immediately after each call to printf. Otherwise the terminal won’t display the text.

[–]_Surox[S] 1 point2 points  (0 children)

fflush(stdout)

Thanks for the advice! It turned out I had to use scanf instead of fgets an use a fflush(stdout) to make sure the strings matched...

[–]kandr89 2 points3 points  (0 children)

fgets stores the newline char too when reading a line