yes p points to the base adress of constant string "hello" so you cannot change this string .
On Thu, Apr 21, 2011 at 4:14 PM, 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. > -- Amit Kumar Singh Software Engineer Samsung India Software Operations Banglore India -- 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.
