I have a character obtained from fgetc(file) stored in the variable i. I want to compare the character contained within i to a constant, i.e. (i == "\n")
, but of course i is of the integer type. I tried ((char)i == "\n")
but it doesn't work. In both cases I get "warning: comparison between pointer and integer", but I'm not sure how to change it from the pointer to the actual value. What should I be doing here?
EDIT
See my answer.