On Thu, Jul 24, 2008 at 12:05 PM, kathir resh <[EMAIL PROTECTED]> wrote:
> char *s1="hello";
>  char *s2="hai"
>  strcpy(s1,s2);
>  printf("%s",s1);
>
>  i am getting the correct output..in previous msg why they said its 
> crashing...

'undefined behaviour' also includes 'appearing to work correctly.'

>  and say in detail about wh difference between char *s1="hello" and char s[ 
> ]="hello";

One is modifiable, the other isn't: http://c-faq.com/decl/strlitinit.html

-- 
PJH

'Two Dead in Baghdad' not 'product-friendly' - Kent Ertugrul, chief
executive of Phorm.

http://shabbleland.myminicity.com

Reply via email to