doubt related to string pointers.
- From: junky_fellow@xxxxxxxxxxx
- Date: 16 May 2005 05:05:19 -0700
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.
.
- Follow-Ups:
- Re: doubt related to string pointers.
- From: Barry Schwarz
- Re: doubt related to string pointers.
- From: Michael Mair
- Re: doubt related to string pointers.
- From: pete
- Re: doubt related to string pointers.
- Prev by Date: Re: linux has typeof, how can i get the same function for windows?
- Next by Date: register variables
- Previous by thread: which is faster ?
- Next by thread: Re: doubt related to string pointers.
- Index(es):
Relevant Pages
|