Tuesday, March 16, 2010

Switch Statements

The following prints out "One":
#include 
int main() {
switch (1) {
if (0) {
case 1:
cout << "One" << endl;
}
}
}
Reference: "C++ Gotchas" by Stephen C. Dewhurst. Addison-Wesley, 2002., p. 18.

No comments:

Post a Comment