Pergunta de entrevista da empresa Futurex

Reverse a string without using a loop in C.

Respostas da entrevista

Sigiloso

20 de out. de 2016

The simplest way to reverse a string or any other container without an explicit loop in C++ is to use reverse iterators: string input; cin >> input; // the pair of iterators rbegin/rend represent a reversed string string output ( input.rbegin ( ), input.rend ( ) ) ; cout << output << endl;

Sigiloso

23 de set. de 2014

The desired method was to use recursion to build a stack and then undo it to print the string.