So I'm reading in chars one by one from a file:
char temp[3];
temp[0] = nextchar;
printf("%c",temp[0]); //prints %
temp[1] = nextchar = fgetc(srcptr);
printf("%c",temp[1]); //prints 2
temp[2] = nextchar = fgetc(srcptr);
printf("%c",temp[2]); //prints 0
if(strcmp(temp, "%20") == 0) { printf("%s","blahblah"); }
Ideally this should print "blahblah" at the end. However, it doesn't. So why is strcmp returning 0, and more importantly: how can I fix it?