why strcpy runs with case 2. but not with case 1 ? bith have same type of arguments…
Problem with string copy
but have a look at the code it is taking string as an argument
- is taking a string as parameter, and that is why giving compilation error
- is taking char* as parameter, and that is why working perfectly (Yes, “hello” is a char array not string)
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
strcpy(a,“hello”) ;// 2.
But it is a string not a character array.
it is written in chords thats why…