Hi all, I want to copy a string to a char array using strcpy function. I just want to ask whether the following is correct
Or should i use:Code:char a; strcpy(a,"Hello");
I have mostly seen the later approach being used, I want to know what is the harm in the first approach?Code:char *ptr,a; ptr=a; strcpy(ptr,"Hello");
Any suggestions would be helpful!