title: Use of undeclared identifier and expected expression error. Xcode
body: <p>So I am completely new to C++ and attempting to use Xcode to write this code that analyzes two integers. I keep getting an error on the "if" line that says "use of undeclared identifier x, and "use of undeclared identifier y" I also get an error on the "else" line that says "Expected expression". What do I need to do/change to make this program work? Help.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void swap (int &amp;x, int &amp;y);
  
  int main()
  { 
      cout &lt;&lt; "Please enter two integers:/n";
      cout &lt;&lt; "First integer ==&gt; " " &gt;&gt; x &gt;&gt; ";
      cout &lt;&lt; "Second integer ==&gt; " " &gt;&gt; y &gt;&gt; ";
      cout &lt;&lt; endl;
  
      if ( &amp;x &lt; &amp;y )
          cout &lt;&lt; "Your integers are in the correct order:/n";
  
      cout &lt;&lt; " &lt;&lt; x &lt;&lt; " " &lt;&lt; y &lt;&lt; ";
  
      else void swap(int &amp;x, int &amp;y);
  
      cout &lt;&lt; "Your integers have been swapped:/n";
      cout &lt;&lt; " &lt;&lt; x &lt;&lt; " " &lt;&lt; y &lt;&lt; ";
  }
  </code></pre>