Deutsche Bank Interview Question

Write a C++ function to reverse a string

Interview Answer

Anonymous

Jun 29, 2021

string reverse(string a){ string s = ""; for(int i=a.length(); i>=0; i--) s+=a[i]; s+='\0'; return s; }