Question d’entretien chez Cisco

Write a program that copies a string to the next location in memory.

Réponse à la question d'entretien

Utilisateur anonyme

28 févr. 2017

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".