I'm using fgets to read lines from a text file I made. I used pico to make the text file, with one word per line (I just hit enter to go to the next line)
I want to compare the words to some variable strings I have, but I find that the strings returned from fgets all have a white space at the end of them.
I tried using the chop() function on them, but this doesn't remove the spaces. Any suggestions?
Thanks
whitespace at end of fgets output
Moderator: General Moderators