So I have a file "input.mal" that I am searching through for specific words. The problem is that after using
Code:
while(fgets(line, sizeof line, inp2) != NULL)
line gets some random quotations inbetween words. And this causes issues because I am using strtok to split up the line at commas, spaces, and tabs. So now these symbols appear as part of the word and cause strcmp to say 2 words arent the same.
Say the line in the file is simply
put avg
when it gets read into line, I get some random stuff. Should I maybe be nulling line after every iteration of the loop? Here is a screen shot of what the debugger is showing. You can see that on line[0] and line[8] there is that "