Pregunta de entrevista de Futurex

Reverse a string without using a loop in C.

Respuestas de entrevistas

Anónimo

20 oct 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;

Anónimo

23 sep 2014

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