I have a problem with the strcpy function. i think that we use it like this but there is a mistake...why?
Is this wrong?
if i want to put the old_buf="hi_my_old_man" into the new_buf which is empty in the beginning.Code:strcpy(new_buf, old_buf);
Code:#include <stdio.h> #include <stdlib.h> int main(void) { int choice; char buf[40]; printf("Before strcpy: %s\n", buf); strcpy(buf,"This is the end my friend"); printf("After: %s\n", buf); return 0; }