title: how to cin text
body: <p>How can I get the user to input text instead of numbers in this program.
  haw can i get the cin statement to accept text? Do i have to use char?</p>
  
  <pre><code>int main()
  {
      using namespace std;
      int x = 5;
      int y = 8;
      int z;
      cout &lt;&lt; "X=" &lt;&lt; x &lt;&lt; endl;
      cout &lt;&lt; "Y=" &lt;&lt; y &lt;&lt; endl;
      cout &lt;&lt; "Do you want to add these numbers?" &lt;&lt; endl;
      int a;
      cin &gt;&gt; a;
      if (a == 1) {
          z = add(x, y);
      }
      if (a == 0) {
          cout &lt;&lt; "Okay" &lt;&lt; endl;
          return  0;
      }
      cout &lt;&lt; x &lt;&lt; "+" &lt;&lt; y &lt;&lt; "=" &lt;&lt; z &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>---EDIT---
  Why won't this work?</p>
  
  <pre><code>int main()
  {
      using namespace std;
      int x = 5;
      int y = 8;
      int z;
      cout &lt;&lt; "X = " &lt;&lt; x &lt;&lt; " Y = " &lt;&lt; y &lt;&lt; endl;
      string text;
      cout &lt;&lt; "Do you want to add these numbers together?" &lt;&lt; endl;
      cin &gt;&gt; text;
      switch (text) {
          case yes:
              z = add(x, y);
              break;
          case no: cout &lt;&lt; "Okay" &lt;&lt; endl;
          default:cout &lt;&lt; "Please enter yes or no in lower case letters" &lt;&lt; endl;
              break;
  }
      return 0;
  }
  </code></pre>
  
  <p>Thank you everybody!
  If you're interested, you can check out the game I made here.
  <a href="http://pastebin.com/pmCEJU8E" rel="nofollow">http://pastebin.com/pmCEJU8E</a>
  You are helping a young programmer accomplish his dreams.</p>