I have this simple program in which I want to concatenate two char pointers using memcpy, but I get access violation writing location on the memcpy line. Why is this happening and what could be done to make it work? Thanks.
char *first = new char[20], *second="world!";
printf("first: ");
scanf("%s",&first);
memcpy(first,second,strlen(second)+1);
printf ("Result: %s, %d \n", first);