title: C2260 undeclared identifier
body: <p>I am getting the error amOrPm undeclared identifier any help? I have tried lots of things and im sure it is something simple. </p>
  
  <p>boy it sure asks me for a lot of details i hope i am explaining it clear enough for everyone.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;iomanip&gt;
  #include &lt;cmath&gt;
  
  
  using namespace std;
  
  // Declare constants
  void input(int&amp;hrs, int&amp;mins, int&amp;amOrPm);
  int covert(int hrs, int amOrPm);
  void outputStime(int hrs, int mins,int amOrPm);
  void outputMtime(int hrs, int mins);
  
   int main()
  {
  // Declare variables below here
  int hrs = 0, mins = 0, amOrPm = 0;
  char choice;
  
  cout &lt;&lt; setiosflags(ios::fixed | ios::showpoint);
  
  do 
  {
      input (hrs, mins, amOrPm);
      covert(hrs, amOrpm);
      outputStime (hrs, mins, amOrPm);
      outputMtime (hrs,mins);
  
  } while (choice != 'q' &amp;&amp; choice != 'Q');
  
  return 0;
  }
  
  void input(int&amp;hrs, int&amp;mins, int&amp;amOrPm)
  {
  cout &lt;&lt; "Enter The Hour: ";
  cin &gt;&gt; hrs;
  
  cout &lt;&lt; "Enter The Minutes: ";
  cin &gt;&gt; mins;
  
  cout &lt;&lt; "Enter 1 AM or 2 for PM: ";
  cin &gt;&gt; amOrPm;
  
  }
  
  int convert(int hrs, int amOrPm)
  {
  
      while (amOrPm = 2)
      {
          if (hrs &gt;= 1)
          {
              hrs = hrs + 12;
              return hrs;
          }
          else
          {
              return hrs;
          }
      }
      while (amOrPm = 1)
      {
          if (hrs &lt;= 11)
          {
              return hrs;
          }
          else
          {
              hrs = hrs - 12;
  
              return hrs;
          }
      }
  }
  
   void outputStime(int hrs, int mins, int amOrPm)
  {
      cout &lt;&lt; " Standard time is: " &lt;&lt; hrs &lt;&lt; ":" &lt;&lt; mins &lt;&lt; amOrPm &lt;&lt;    endl;
  }
  
  void outputMtime(int hrs, int mins, int amOrPm)
  {
      cout &lt;&lt; " Standard time is: " &lt;&lt; hrs &lt;&lt; ":" &lt;&lt; mins &lt;&lt; endl;
  }
  </code></pre>