title: Transfer of control bypasses initialization of:?
body: <p>I'm just going over classes but I get this error which stops me blank. I've looked through other threads but no clue what's wrong with my code? I've commented the code which is the issue.</p>
  
  <pre><code>class myClass { //Class which might cause an issue? Don't see whats wrong    with it.
  public:
  myClass(string nm) {
      setName(nm);
  }
  void setName(string x) {
      name = x;
  }
  string getName() {
      return name;
  }
  
  private:
      string name;
  };
  
  int main() {
  cout &lt;&lt; "Task 1, Task 2, Task 3, Task 4 ?" &lt;&lt; endl;
  int answer;
  cin &gt;&gt; answer;
  switch (answer)
  {
  case 1://Practising Classes
      CRectangle area;
      cout &lt;&lt; "Enter two numbers \n";
      cin &gt;&gt; area.x;
      cin &gt;&gt; area.y;
      cout &lt;&lt; "Area is: "&lt;&lt; area.findArea() &lt;&lt; endl;
      break;
  case 2://Practising Classes
      AddNumbers myObj1;
      myObj1.getNumbers();
      cout  &lt;&lt; myObj1.addNumbers() &lt;&lt; endl;
  case 3: //Practising Classes
      birthdays b1;
      cout &lt;&lt; "Welcome to Birthdays! \n";
      bool bool1 = false;
      do {
      cout &lt;&lt; "Do you want to enter some data (1) or retrieve some? \n";
      int answer;
      cin &gt;&gt; answer;
      switch (answer)
      {
      case 1:
          b1.setdata();
          break;
      case 2:
          b1.getdata();
      }
      } while (bool1 == false);
  case 4: // This causes the error. // Testing out Constructors
      myClass object("David");
      myClass object2("Amy");
      cout &lt;&lt; object.getName();
  }
  system("PAUSE");
  }
  </code></pre>