As i mention earlier this s a literal...
Wel a literal as is allotted space in the memory.. Think its heaps..
Then a reference is made to tat location in the declaration of char pointer..
You can access it but cant be altered...:-)
Regards,
Keybo
-----Original message-----
From: riti gupta
Sent:  21/04/2011, 4:25  pm
To: [email protected]
Subject: Re: [algogeeks]


Than y r we able to do the following

main()
{
char *p="hello";
p="bye";
}

On Thu, Apr 21, 2011 at 4:21 PM, Sudhir mishra <[email protected]>wrote:

> yes there is error;
> first allocate memory for p;
>
>
> On Thu, Apr 21, 2011 at 6:44 AM, riti gupta <[email protected]> wrote:
>
>> is there any error in following code?
>>
>> main
>> {
>>  char *p="hello";
>>  p[0]='j';
>> p[1]='j';
>> puts(p);
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
>
> [image: motilal.JPG]
> Thanks & Regards...*
> SUDHIR MISHRA <[email protected]>*
> *IT 3rd YEAR*
> *Motilal Nehru National institute Of Technology-ALLAHABAD.
> *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to