I have created a char* str_1 and have allocated 64 bytes to it.
Then I created another char* str_2 and referenced it to the initial string.
char* str_1 = new char[64];
char* str_2 = str_1; // does it reference the object created with the new statement.
My question is, does str_2 contain the reference to the allocated memory? In which case, could I do something like this?
char* str_1 = new char[64];
char* str_2 = str_1;
delete[] str_2;
Is calling delete[] str_2 actually deleting the allocated memory? Or, is it causing a memory leak?