Friday, November 12, 2010

Case Label Typos Compile

The following compiles:

   #include <iostream>
   using namespace std;
   int main(int argc, char *argv[]) {
      switch (argc) {
       case 1: cout << "one"   << endl; return 1;
       case 2: cout << "two"   << endl; return 2;
       def:    cout << "other" << endl; return 0;
      }
   }

No comments:

Post a Comment