title: reverse of the string using recursion
body: <p>Hey guys i get stuck in the unusual situation. This is my code, it works perfectly for returning the reverse of the string but it gives output with including the space so I don't want that space to be included in my programme output so anyone has suggestions about this plz share it... by the way this is my code :</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  string reverse(string str, int size) {
    if (size == -1)
      return "";
    else
      {
        char a;
        a = str[size];
        return a + reverse(str, size - 1);
      }
  }
  
  int main() {
    int size;
    cout &lt;&lt; "the size of the string : ";
    cin &gt;&gt; size;
    string str;
    cout &lt;&lt; "enter the word : ";
    cin &gt;&gt; str;
    cout &lt;&lt; reverse(str, size);
  }
  </code></pre>