huge string-pointer problem
I have a big problem with pointers and strings -- it seems that I cannot compare string with another string. In the code snippet below, i am trying to compare normal. with whatever value is in the word variable at the moment. If there is a "normal." then the script ouputs 0, if not, then an 1.
The problem is that where the script should output 0, it outputs 1. And where there it should output 1, it outputs 1 (no problem here).
The code deals with the input of many lines, each line having 42 fields separated from each other by comma. The code finds the 42nd field which contains either normal. value or any other word with dot at the end.
What should I do? Please help ASAP: please answer on the same day this message was posted.
// read in one line
char word = "";
p = strtok(buff,",");
for(int i=0; i<42; i++)
p = strtok(NULL,",");
outfile << endl;