Nonportable pointer conversion
Another Noob Question :confused: - My code is not working as i expect it to.
In the following code (userAns - userAns all = 1) and (userAns - userAns all = 0)
When run i would expect the 0-5 values to return a correct message and the 6-9 values to return wrong, but all values return the question is wrong text?
The program does run but not correctly and i just noticed that the line " if (userAns[i] == 1) " gets a Nonportable pointer conversion error.
Being a total noob looking at the code i wrote i dont understand why when userAns[i] has a value of 1 that it does not display question correct.
What am i doing wrong?
//FUNCTION TO DISPLAY WRONG OR CORRECT
int score (void)
int i, correct;
correct = 0;
for (i=0; i<=q; i++)
printf ("\n%s", userAns[i]);
if (userAns[i] == 1)
printf("\n%s\nYou got this question correct", mystr[i]);
printf("\n%s\nYou got this question wrong", mystr[i]);