title: Why won't my do-while loop continue looping?
body: <p>I'm working on creating a menu with error checking and this is what I've come up with, but I can't seem to get it to work.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() 
  {
  
  char option; // user's entered option will be saved in this variable
  int error1 = 0;
  
   //Displaying Options for the menu
  cout &lt;&lt; "There are three packages available." &lt;&lt; endl;
  cout &lt;&lt; "Monthly Price - Price per MB for overages (excluding C)" &lt;&lt; endl;
  cout &lt;&lt; "A) $15 - $.06 for each MB after 200 MB." &lt;&lt; endl;
  cout &lt;&lt; "B) $25 - $.02 for each MB after 2,000 MB ( approx. 2 GB)." &lt;&lt; endl;
  cout &lt;&lt; "C) $50 - Unlimited data." &lt;&lt; endl;
  
  do //do-while loop starts here
  { 
  
   //Prompting user to enter an option according to menu
   cout &lt;&lt; "Please enter which plan you currently have : ";
   cin &gt;&gt; option;  // taking option value as input and saving in variable "option"
  
   if(option == 'A' || option == 'a') // Checking if user selected option 1
   {
      cout &lt;&lt; "You chose a" &lt;&lt; endl;
      error1 = 1;
   }
   else if(option == 'B' || option == 'b') // Checking if user selected option 2
   {
      cout &lt;&lt; "You chose b" &lt;&lt; endl;
      error1 = 1;
   }
   else if(option == 'C' || option == 'c') // Checking if user selected option 3
   {
      cout &lt;&lt; "You chose c" &lt;&lt; endl;
      error1 = 1;
   }
   else //if user has entered invalid choice 
   {
     //Displaying error message
     error1 = 0;
     cout &lt;&lt; "Invalid Option entered";
   }
   }
  while(error1 = 0);  //condition of do-while loop
  return 0;
  }
  </code></pre>
  
  <p>When typing in an incorrect value, the output will be Invalid Option entered; however, it won't loop back to the beginning and prompt the user for input again.</p>
  
  <p>Why is it doing this?</p>