title: C++ cross initiialization error
body: <p>When compiling the following code it provides me with two errors; "jump to case label" and "crosses initialization of std::ofstream SaveLogin". I am currently using codeblocks with the gnu gcc compiler. </p>
  
  <pre><code>switch(choice) {
    case 1:
      // login
    case 2:
      // register
      ofstream SaveLogin;
      break;
    case 3:
      // reset password
  
  ;}
  </code></pre>
  
  <p>Thanks for viewing my question-EDIT: my question was flagged as a duplicate of another question but the question specified did not entirely conclude my problem. This post is specifically about my problem although I hope it can hope any other people who are having the same problem</p>