Commit d88bdd29 authored by Michael's avatar Michael

michael.davityan:exercise_07_36v3

parent 866f4217
......@@ -3,12 +3,12 @@
#include <string>
void
stringReverse(std::string& string, const size_t firstIdx = 0)
stringReverse(const std::string& string, const size_t counterForReversing = 0)
{
const int sizeOfString = string.size();
if ('\0' != string[firstIdx]) {
std::cout << string[(sizeOfString - 1) - firstIdx];
return stringReverse(string, firstIdx + 1);
if ('\0' != string[counterForReversing]) {
std::cout << string[(sizeOfString - 1) - counterForReversing];
return stringReverse(string, counterForReversing + 1);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment