T
Tagore
hi,
#include <stdio.h>
int main(void){
char *s="LET";
char *t="LET";
if(s==t)
printf("same");
else
printf("different");
return 0;
}
In above code, output is "same".
but I expected output to be "different". I think that s and t points
to string literals present at different addresses.
Can any one please help me in understanding its output.
Regards,
#include <stdio.h>
int main(void){
char *s="LET";
char *t="LET";
if(s==t)
printf("same");
else
printf("different");
return 0;
}
In above code, output is "same".
but I expected output to be "different". I think that s and t points
to string literals present at different addresses.
Can any one please help me in understanding its output.
Regards,