title: Reversing A String in C++ (Using Recursion)
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  void ReverseString(string &amp;S, int size)
  {
      static int start = 0;
      if (start == size - 1 || start == size)
      {
          return;
      }
      else
      {
          swap(S[start++], S[size - 1]);
          ReverseString(S, size - 1);
      }
  }
  int main()
  {
      cout &lt;&lt; "enter a string to reverse" &lt;&lt; endl;
      string s;
      getline(cin, s);
      cout &lt;&lt; "Before Reversing" &lt;&lt; endl;
      cout &lt;&lt; s &lt;&lt; endl;
      ReverseString(s, s.size());
      cout &lt;&lt; "After Reversing" &lt;&lt; endl;
      cout &lt;&lt; s &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>I am trying to nail recursions as much as i can,and i was trying to reverse a string using recursion
  i didn't know how to do it at first,tried many different ways to do it,but i saw code samples on string reversing,but none of it made sense to me,so i made my own one,but not quite sure of it,i'm just asking for opinion,is it clean and functional??</p>
  
  <p>Thank You</p>