title: Properly reversing a string in C++ using strrev
body: <p>I would like the user to enter the string for strrev to reverse however when the user enters the string spaces are not allowed for some reason so if someone enters hello my name is stan. the output is only nats, How can i get the function to accept white space?</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include &lt;cstring&gt;
  #include&lt;string.h&gt;
  using namespace std;
  int main()
  {
      char str[] = "This is a c-StyleString";
      //cout &lt;&lt;"Enter the string:" &lt;&lt; endl;
      //cin &gt;&gt; str;
      cout &lt;&lt; "Reverse of the given string is: " &lt;&lt; strrev(str);
      return 0;
  }
  </code></pre>