why can't we compare two strings in c program directly.For example i have tried the following example
char *str="int";
if(str=="int")
printf("yes");
else
printf("no");
For the above I got output as "no" I have tried the above code by using the same logic as if for integers ie
int i=10;
if(i==10)
printf("same");
But when I have modified the above code like the following
if((strcmp(str,"int"))==0)
printf("yes");
I got the output as "yes" What is the problem in the first stated code?