Warning comparison between pointer and integer in C language

I’m assuming that this “type_of_assessment” variable is of char * (pointer to a character) so when you are comparing a character to a char pointer it throws this error. This char * variable stores the address of the actual value stored so you have to de reference it first. Try this in your if condition:

if (*type_of_assessment == 'Q') {...}

Leave a Comment