Write a program that copies a string to the next location in memory.
Utilisateur anonyme
One potential solution is to use an array, since those are just blocks of contiguous memory. In C++: int main() { string str_arr[2] = {"hello"}; str_arr[1] = str_arr[0]; cout << str_arr[1]; } And the output should be "hello".