Hello, I'm new to programming forums so go easy on me :)
I'm working on an assignment for school.
I have to read a quiz.dat file which cotains info in the format of:
TTTTTFFFFFTTTTT
TTTTTFFFFF TTTTJoe Jones
TTTTTFFFFFT TTFMary Jane
...
... etc.
The first line being the answer key and subsequent being the persons answers followed by their names
I can read in key and initial answer and persons name but my loop to compare the arrays isnt working so well was wondering if i could get a hint
My problem i think is not being able to sort through it i have 3 int variables named correct, missing, wrong
thinking...
for(int i = 0; i < sizeof(answer); i++)
{
if(answer[i] == key[i] && answer[i] != ' ')
correct++
}
this is the first part wondering why something like this wouldnt work im getting a logic error its not counting my spaces, correct and wrong matches
anything helps and if you need to see more code ill post it im at work tryin to do this while boss is gone for a few mins.
-James