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.
I am not a C++ expert, but I think that when you call scanf you must pass a pointer. The problem is that first is a pointer to char (that is the right parameter), but you are passing a pointer to pointer to char.
When you call scanf to get a string you should not use &. The name of the array is itself a pointer.
Ancient Dragon, you have detected some errors, but, forgive me if I am wrong, in line 2:
Is a literal string that contains the name of a variable, but it is not the variable.
Please, forgive my mistakes.