' Hello '  is a literal.. Its allotted memory and a reference is made to 'p'
you can not alter value like this...  
Regards,
Keybo
-----Original message-----
From: riti gupta
Sent:  21/04/2011, 4:14  pm
To: [email protected]
Subject: [algogeeks]


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.


-- 
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