title: Need help creating a function and error with switch statement
body: <p>I'm using a switch statement to process through some code, which I will create a function in my main to call. I'm having trouble with the switch quantity with my switch statement. Also, how would I create a function for these 10 cases? Very confused, any help greatly appreciated! Thanks! Here is my current code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  void constitution(); // the function that will call my amendments in my main function
                       // how will i create this will 10 possible amendments to choose from?
                       // There are 4 pirates and they will vote either yes or no,
  int main()
  {
    cout &lt;&lt; "Below is a list of the 10 amendments that the two pirates will vote on  according to the ships constitution" &lt;&lt; endl;
    string amendments = 0;
    cin &gt;&gt; amendments;    // selecting the amendment
    switch (amendments)
    { 
      // for outputting the amendment(s) voted on, which will
      // be passed on to a function in main to call
      case 1: cout &lt;&lt; "What does the fox say? Whatever WE tell it to";  //case 1-10 are the 10 amendments to be voted on
              break;
      case 2: cout &lt;&lt; "From now on the annual Cinco de Mayo party will be held on March 8th ";
              break;
      case 3: cout &lt;&lt; "Beginning this year, sharks shall have a week dedicated to us";
              break;
      case 4: cout &lt;&lt; "Pirates are now allowed to talk about fight club";
              break;
      case 5: cout &lt;&lt; "When in Rome, the Romans will do as WE do.";
              break;
      case 6: cout &lt;&lt; "Our mothers will immediately get tattoos that say SON";
              break;
      case 7: cout &lt;&lt; "From now on the President will take our birthdays off.";
              break;
      case 8: cout &lt;&lt; "If we say something costs an arm and a leg, it does";
              break;
      case 9: cout &lt;&lt; "Freemasons are ordered to learn OUR secret handshake.";
              break;
      case 10: cout &lt;&lt; "If a tree falls in the forest and no one is around, it will make a sound only with our permission ";
              break;
      default: cout &lt;&lt; "This won't be used since a amendment will always be voted on, thus never be shown or checked I believe.. (Please correct me) ";
              break;
    }
    return 0;
  }
  </code></pre>