I have the following program
#include <stdio.h>
#include <stdlib.h>
int main()
{
char string[30],ch,*chp;
printf("Enter Text below:");
gets(string);
printf("\n Character to find:");
ch=getchar();
chp=strchr(string,ch);
if(chp)
printf("Character %c found in string",ch);
else
printf("Character %c not found in string",ch);
getche();
}
i know chp is pointer in this program , but in the if statement , the chp is not compared to any pointer , but how this if statment is executed , please help to understand this program.