uhm... which one would be better to use for a menu hack?
BTW these are random examples I made up...
switch -
if-else -Code:switch (x) { case 1: cout << "x is x"; break; case 2: cout << "x is xx"; break; default: cout << "value of x unknown"; }
YES I KNOW THEY ARE EQUIVALENT, BUT WHICH IS MORE EFFICIENT?Code:if (x == 1) { cout << "x is 1"; } else if (x == 2) { cout << "x is 2"; } else { cout << "value of x unknown"; }