title: How I can manage to keep white space in my String from user input
body: <p>I'm coding a little console application in C++ and in it I take a string from the user:</p>
  <pre><code>cin &gt;&gt; themainstring;
  int si = 0;
  while (themainstring[si] != '+' || themainstring[si] != '-' ||
          themainstring[si] != '*') {
      if (themainstring[si] == '+' || themainstring[si] == '-' ||
              themainstring[si] == '*') {
          lmnopt = themainstring[si];
          break; // while
      }
      si++;
  }
  int strlenthestring = themainstring.size();
  lmnop1 = themainstring.substr(0, si);
  lmnop2 = themainstring.substr(si + 1, strlenthestring);
  </code></pre>
  <p>So for example, when I give this input:</p>
  <blockquote>
  <p>ilove+programming</p>
  </blockquote>
  <p>I want to try and cut the string when I see +, - and *. which works fine.</p>
  <p>However I want my code to do the same when I input:</p>
  <blockquote>
  <p>ilove + programming (white spaces after and before arithmetical operator)</p>
  </blockquote>
  <p>I have messed around with the WS but I couldn't understand the logic.</p>
  <p>Actually the main problem of mine is about C++'s space logic. Why it thinks the space will explode the string input?</p>