strange behavior of char pointers
===

i have the following question. 
when i declare the following

main()
{

      char *p="boa";
      *(p+1)='y';
      printf("%s",p); 

}

gives me a seg. fault. i suspect char *p is a constant & etc. 

but the following

main()
{

      int i=300;
      char *p=(char*)&i;
      *(p+1)='y';
      printf("%s",p); 

}

works fine. do you have any idea about the reason behind this? isn't the above rule apply to this as well? 