Hi there,

I need your help in pointer. I have problem to copy a String from one to another by just passing one string address to another.

see the snippet,


void main()
{
char *str= "ABC";
char *str1="DEF";
COPY(str,str1);

printf("%s",str);

}

void COPY(char *String1, char *String2)
{
String1=String2;
}

If I run this program my system hanging after printing 'str'.

Why this was happening?

Can you help me?