title: Xcode doesn't let me initialize values in C++
body: <p>I'm currently using Stroustrup's book Programming -- Principles and Practice Using C++ to pick up C++. One of the topics regards initializing variables. Consider the following example in the book:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "std_lib_facilities.h"
  
  int main()
  {
      cout &lt;&lt; "please enter your first_name and age\n";
      string first_name = "???"; // string variable
      // ("???" means "don't know the name")
      int age = -1;              // integer variable (-1 means "don't know the age")
      cin &gt;&gt; first_name &gt;&gt; age;  // read a string followed by an integer
      cout &lt;&lt; "Hello, " &lt;&lt; first_name &lt;&lt; " (age " &lt;&lt; age &lt;&lt; ")\n";
  }
  </code></pre>
  
  <p>In the code, the variable age is supposed to be initialized as -1. However, in Xcode, when I tried to build and run it, age is set to be 0 when I typed in something that's not an integer for age. For example, if I type in "22 Carlos", the script returns 0 for age. According to the book, I'm supposed to see -1. </p>
  
  <p>I'm using Xcode as my IDE. Does it have something to do with the IDE?</p>