J
junky_fellow
what would be the output for the following piece of code ?
if ( "hello" == "hello" )
printf("True\n");
else
printf("False\n");
What is the reason for that ?
-----------------------------------------------------
Secondly, consider the following piece of code.
void main(void)
{
char *str= "hello world";
}
I have seen may C tutorials that say that "str" cannot be
modified. What is the reason for that ? I tried this piece of
code on my machine and I was successfully able to modify it.
if ( "hello" == "hello" )
printf("True\n");
else
printf("False\n");
What is the reason for that ?
-----------------------------------------------------
Secondly, consider the following piece of code.
void main(void)
{
char *str= "hello world";
}
I have seen may C tutorials that say that "str" cannot be
modified. What is the reason for that ? I tried this piece of
code on my machine and I was successfully able to modify it.