J
junky_fellow
Consider the following piece of code:
char *str = "Hello";
if (str = "Hello")
printf("\nstring matches\n");
str is pointer to char and "Hello" is a string literal whose
type is "array of char".
How can we compare two different objects for equality ?
Is some conversion is being done before that comparison ?
If yes, which conversion rule from C standard is applied here ?
char *str = "Hello";
if (str = "Hello")
printf("\nstring matches\n");
str is pointer to char and "Hello" is a string literal whose
type is "array of char".
How can we compare two different objects for equality ?
Is some conversion is being done before that comparison ?
If yes, which conversion rule from C standard is applied here ?