Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Something You May Not Know About the Switch Statement in C/C++

, 19 Dec 2012 CPOL
A discussion on how switch/case is executed, by reverse engineering in VC++
#include "functions.h"

int main2()
{
    int i =1000;

    switch (i)
    {
        case 0: f1(); break;
        case 1: f1(); break;
        case 2: f2(); break;
        case 3: f1(); break;
        case 4: f1(); break;
        case 5: f1(); break;
        case 6: f1(); break;
        case 7: f1(); break;
        case 8: f2(); break;
        case 9: f1(); break;

        case 10: f1(); break;
        case 11: f1(); break;
        case 12: f2(); break;
        case 13: f1(); break;
        case 14: f1(); break;
        case 15: f1(); break;
        case 16: f1(); break;
        case 17: f1(); break;
        case 18: f2(); break;
        case 19: f1(); break;

        case 20: f1(); break;
        case 21: f1(); break;
        case 22: f2(); break;
        case 23: f1(); break;
        case 24: f1(); break;
        case 25: f1(); break;
        case 26: f1(); break;
        case 27: f1(); break;
        case 28: f2(); break;
        case 29: f1(); break;

        case 30: f1(); break;
        case 31: f1(); break;
        case 32: f2(); break;
        case 33: f1(); break;
        case 34: f1(); break;
        case 35: f1(); break;
        case 36: f1(); break;
        case 37: f1(); break;
        case 38: f2(); break;
        case 39: f1(); break;

        case 40: f1(); break;
        case 41: f1(); break;
        case 42: f2(); break;
        case 43: f1(); break;
        case 44: f1(); break;
        case 45: f1(); break;
        case 46: f1(); break;
        case 47: f1(); break;
        case 48: f2(); break;
        case 49: f1(); break;

        case 50: f1(); break;
        case 51: f1(); break;
        case 52: f2(); break;
        case 53: f1(); break;
        case 54: f1(); break;
        case 55: f1(); break;
        case 56: f1(); break;
        case 57: f1(); break;
        case 58: f2(); break;
        case 59: f1(); break;

        case 60: f1(); break;
        case 61: f1(); break;
        case 62: f2(); break;
        case 63: f1(); break;
        case 64: f1(); break;
        case 65: f1(); break;
        case 66: f1(); break;
        case 67: f1(); break;
        case 68: f2(); break;
        case 69: f1(); break;

        case 70: f1(); break;
        case 71: f1(); break;
        case 72: f2(); break;
        case 73: f1(); break;
        case 74: f1(); break;
        case 75: f1(); break;
        case 76: f1(); break;
        case 77: f1(); break;
        case 78: f2(); break;
        case 79: f1(); break;

        case 80: f1(); break;
        case 81: f1(); break;
        case 82: f2(); break;
        case 83: f1(); break;
        case 84: f1(); break;
        case 85: f1(); break;
        case 86: f1(); break;
        case 87: f1(); break;
        case 88: f2(); break;
        case 89: f1(); break;

        case 90: f1(); break;
        case 91: f1(); break;
        case 92: f2(); break;
        case 93: f1(); break;
        case 94: f1(); break;
        case 95: f1(); break;
        case 96: f1(); break;
        case 97: f1(); break;
        case 98: f2(); break;
        case 99: f1(); break;

        case 100: f1(); break;
        case 101: f1(); break;
        case 102: f2(); break;
        case 103: f1(); break;
        case 104: f1(); break;
        case 105: f1(); break;
        case 106: f1(); break;
        case 107: f1(); break;
        case 108: f2(); break;
        case 109: f1(); break;

        case 110: f1(); break;
        case 111: f1(); break;
        case 112: f2(); break;
        case 113: f1(); break;
        case 114: f1(); break;
        case 115: f1(); break;
        case 116: f1(); break;
        case 117: f1(); break;
        case 118: f2(); break;
        case 119: f1(); break;

        case 120: f1(); break;
        case 121: f1(); break;
        case 122: f2(); break;
        case 123: f1(); break;
        case 124: f1(); break;
        case 125: f1(); break;
        case 126: f1(); break;
        case 127: f1(); break;
        case 128: f2(); break;
        case 129: f1(); break;

        case 130: f1(); break;
        case 131: f1(); break;
        case 132: f2(); break;
        case 133: f1(); break;
        case 134: f1(); break;
        case 135: f1(); break;
        case 136: f1(); break;
        case 137: f1(); break;
        case 138: f2(); break;
        case 139: f1(); break;

        case 140: f1(); break;
        case 141: f1(); break;
        case 142: f2(); break;
        case 143: f1(); break;
        case 144: f1(); break;
        case 145: f1(); break;
        case 146: f1(); break;
        case 147: f1(); break;
        case 148: f2(); break;
        case 149: f1(); break;

        case 150: f1(); break;
        case 151: f1(); break;
        case 152: f2(); break;
        case 153: f1(); break;
        case 154: f1(); break;
        case 155: f1(); break;
        case 156: f1(); break;
        case 157: f1(); break;
        case 158: f2(); break;
        case 159: f1(); break;

        case 160: f1(); break;
        case 161: f1(); break;
        case 162: f2(); break;
        case 163: f1(); break;
        case 164: f1(); break;
        case 165: f1(); break;
        case 166: f1(); break;
        case 167: f1(); break;
        case 168: f2(); break;
        case 169: f1(); break;

        case 170: f1(); break;
        case 171: f1(); break;
        case 172: f2(); break;
        case 173: f1(); break;
        case 174: f1(); break;
        case 175: f1(); break;
        case 176: f1(); break;
        case 177: f1(); break;
        case 178: f2(); break;
        case 179: f1(); break;

        case 180: f1(); break;
        case 181: f1(); break;
        case 182: f2(); break;
        case 183: f1(); break;
        case 184: f1(); break;
        case 185: f1(); break;
        case 186: f1(); break;
        case 187: f1(); break;
        case 188: f2(); break;
        case 189: f1(); break;

        case 190: f1(); break;
        case 191: f1(); break;
        case 192: f2(); break;
        case 193: f1(); break;
        case 194: f1(); break;
        case 195: f1(); break;
        case 196: f1(); break;
        case 197: f1(); break;
        case 198: f2(); break;
        case 199: f1(); break;

        case 200: f1(); break;
        case 201: f1(); break;
        case 202: f2(); break;
        case 203: f1(); break;
        case 204: f1(); break;
        case 205: f1(); break;
        case 206: f1(); break;
        case 207: f1(); break;
        case 208: f2(); break;
        case 209: f1(); break;

        case 210: f1(); break;
        case 211: f1(); break;
        case 212: f2(); break;
        case 213: f1(); break;
        case 214: f1(); break;
        case 215: f1(); break;
        case 216: f1(); break;
        case 217: f1(); break;
        case 218: f2(); break;
        case 219: f1(); break;

        case 220: f1(); break;
        case 221: f1(); break;
        case 222: f2(); break;
        case 223: f1(); break;
        case 224: f1(); break;
        case 225: f1(); break;
        case 226: f1(); break;
        case 227: f1(); break;
        case 228: f2(); break;
        case 229: f1(); break;

        case 230: f1(); break;
        case 231: f1(); break;
        case 232: f2(); break;
        case 233: f1(); break;
        case 234: f1(); break;
        case 235: f1(); break;
        case 236: f1(); break;
        case 237: f1(); break;
        case 238: f2(); break;
        case 239: f1(); break;

        case 240: f1(); break;
        case 241: f1(); break;
        case 242: f2(); break;
        case 243: f1(); break;
        case 244: f1(); break;
        case 245: f1(); break;
        case 246: f1(); break;
        case 247: f1(); break;
        case 248: f2(); break;
        case 249: f1(); break;

        case 250: f1(); break;
        case 251: f1(); break;
        case 252: f2(); break;
        case 253: f1(); break;
        case 254: f1(); break;
        case 255: f1(); break;
        case 256: f1(); break;
        case 257: f1(); break;
        case 258: f2(); break;
        case 259: f1(); break;

        case 260: f1(); break;
        case 261: f1(); break;
        case 262: f2(); break;
        case 263: f1(); break;
        case 264: f1(); break;
        case 265: f1(); break;
        case 266: f1(); break;
        case 267: f1(); break;
        case 268: f2(); break;
        case 269: f1(); break;

        case 270: f1(); break;
        case 271: f1(); break;
        case 272: f2(); break;
        case 273: f1(); break;
        case 274: f1(); break;
        case 275: f1(); break;
        case 276: f1(); break;
        case 277: f1(); break;
        case 278: f2(); break;
        case 279: f1(); break;

        case 280: f1(); break;
        case 281: f1(); break;
        case 282: f2(); break;
        case 283: f1(); break;
        case 284: f1(); break;
        case 285: f1(); break;
        case 286: f1(); break;
        case 287: f1(); break;
        case 288: f2(); break;
        case 289: f1(); break;

        case 290: f1(); break;
        case 291: f1(); break;
        case 292: f2(); break;
        case 293: f1(); break;
        case 294: f1(); break;
        case 295: f1(); break;
        case 296: f1(); break;
        case 297: f1(); break;
        case 298: f2(); break;
        case 299: f1(); break;

        case 300: f1(); break;
        case 301: f1(); break;
        case 302: f2(); break;
        case 303: f1(); break;
        case 304: f1(); break;
        case 305: f1(); break;
        case 306: f1(); break;
        case 307: f1(); break;
        case 308: f2(); break;
        case 309: f1(); break;

        case 310: f1(); break;
        case 311: f1(); break;
        case 312: f2(); break;
        case 313: f1(); break;
        case 314: f1(); break;
        case 315: f1(); break;
        case 316: f1(); break;
        case 317: f1(); break;
        case 318: f2(); break;
        case 319: f1(); break;

        case 320: f1(); break;
        case 321: f1(); break;
        case 322: f2(); break;
        case 323: f1(); break;
        case 324: f1(); break;
        case 325: f1(); break;
        case 326: f1(); break;
        case 327: f1(); break;
        case 328: f2(); break;
        case 329: f1(); break;

        case 330: f1(); break;
        case 331: f1(); break;
        case 332: f2(); break;
        case 333: f1(); break;
        case 334: f1(); break;
        case 335: f1(); break;
        case 336: f1(); break;
        case 337: f1(); break;
        case 338: f2(); break;
        case 339: f1(); break;

        case 340: f1(); break;
        case 341: f1(); break;
        case 342: f2(); break;
        case 343: f1(); break;
        case 344: f1(); break;
        case 345: f1(); break;
        case 346: f1(); break;
        case 347: f1(); break;
        case 348: f2(); break;
        case 349: f1(); break;

        case 350: f1(); break;
        case 351: f1(); break;
        case 352: f2(); break;
        case 353: f1(); break;
        case 354: f1(); break;
        case 355: f1(); break;
        case 356: f1(); break;
        case 357: f1(); break;
        case 358: f2(); break;
        case 359: f1(); break;

        case 360: f1(); break;
        case 361: f1(); break;
        case 362: f2(); break;
        case 363: f1(); break;
        case 364: f1(); break;
        case 365: f1(); break;
        case 366: f1(); break;
        case 367: f1(); break;
        case 368: f2(); break;
        case 369: f1(); break;

        case 370: f1(); break;
        case 371: f1(); break;
        case 372: f2(); break;
        case 373: f1(); break;
        case 374: f1(); break;
        case 375: f1(); break;
        case 376: f1(); break;
        case 377: f1(); break;
        case 378: f2(); break;
        case 379: f1(); break;

        case 380: f1(); break;
        case 381: f1(); break;
        case 382: f2(); break;
        case 383: f1(); break;
        case 384: f1(); break;
        case 385: f1(); break;
        case 386: f1(); break;
        case 387: f1(); break;
        case 388: f2(); break;
        case 389: f1(); break;

        case 390: f1(); break;
        case 391: f1(); break;
        case 392: f2(); break;
        case 393: f1(); break;
        case 394: f1(); break;
        case 395: f1(); break;
        case 396: f1(); break;
        case 397: f1(); break;
        case 398: f2(); break;
        case 399: f1(); break;

        case 400: f1(); break;
        case 401: f1(); break;
        case 402: f2(); break;
        case 403: f1(); break;
        case 404: f1(); break;
        case 405: f1(); break;
        case 406: f1(); break;
        case 407: f1(); break;
        case 408: f2(); break;
        case 409: f1(); break;

        case 410: f1(); break;
        case 411: f1(); break;
        case 412: f2(); break;
        case 413: f1(); break;
        case 414: f1(); break;
        case 415: f1(); break;
        case 416: f1(); break;
        case 417: f1(); break;
        case 418: f2(); break;
        case 419: f1(); break;

        case 420: f1(); break;
        case 421: f1(); break;
        case 422: f2(); break;
        case 423: f1(); break;
        case 424: f1(); break;
        case 425: f1(); break;
        case 426: f1(); break;
        case 427: f1(); break;
        case 428: f2(); break;
        case 429: f1(); break;

        case 430: f1(); break;
        case 431: f1(); break;
        case 432: f2(); break;
        case 433: f1(); break;
        case 434: f1(); break;
        case 435: f1(); break;
        case 436: f1(); break;
        case 437: f1(); break;
        case 438: f2(); break;
        case 439: f1(); break;

        case 440: f1(); break;
        case 441: f1(); break;
        case 442: f2(); break;
        case 443: f1(); break;
        case 444: f1(); break;
        case 445: f1(); break;
        case 446: f1(); break;
        case 447: f1(); break;
        case 448: f2(); break;
        case 449: f1(); break;

        case 450: f1(); break;
        case 451: f1(); break;
        case 452: f2(); break;
        case 453: f1(); break;
        case 454: f1(); break;
        case 455: f1(); break;
        case 456: f1(); break;
        case 457: f1(); break;
        case 458: f2(); break;
        case 459: f1(); break;

        case 460: f1(); break;
        case 461: f1(); break;
        case 462: f2(); break;
        case 463: f1(); break;
        case 464: f1(); break;
        case 465: f1(); break;
        case 466: f1(); break;
        case 467: f1(); break;
        case 468: f2(); break;
        case 469: f1(); break;

        case 470: f1(); break;
        case 471: f1(); break;
        case 472: f2(); break;
        case 473: f1(); break;
        case 474: f1(); break;
        case 475: f1(); break;
        case 476: f1(); break;
        case 477: f1(); break;
        case 478: f2(); break;
        case 479: f1(); break;

        case 480: f1(); break;
        case 481: f1(); break;
        case 482: f2(); break;
        case 483: f1(); break;
        case 484: f1(); break;
        case 485: f1(); break;
        case 486: f1(); break;
        case 487: f1(); break;
        case 488: f2(); break;
        case 489: f1(); break;

        case 490: f1(); break;
        case 491: f1(); break;
        case 492: f2(); break;
        case 493: f1(); break;
        case 494: f1(); break;
        case 495: f1(); break;
        case 496: f1(); break;
        case 497: f1(); break;
        case 498: f2(); break;
        case 499: f1(); break;

        case 500: f1(); break;
        case 501: f1(); break;
        case 502: f2(); break;
        case 503: f1(); break;
        case 504: f1(); break;
        case 505: f1(); break;
        case 506: f1(); break;
        case 507: f1(); break;
        case 508: f2(); break;
        case 509: f1(); break;

        case 510: f1(); break;
        case 511: f1(); break;
        case 512: f2(); break;
        case 513: f1(); break;
        case 514: f1(); break;
        case 515: f1(); break;
        case 516: f1(); break;
        case 517: f1(); break;
        case 518: f2(); break;
        case 519: f1(); break;

        case 520: f1(); break;
        case 521: f1(); break;
        case 522: f2(); break;
        case 523: f1(); break;
        case 524: f1(); break;
        case 525: f1(); break;
        case 526: f1(); break;
        case 527: f1(); break;
        case 528: f2(); break;
        case 529: f1(); break;

        case 530: f1(); break;
        case 531: f1(); break;
        case 532: f2(); break;
        case 533: f1(); break;
        case 534: f1(); break;
        case 535: f1(); break;
        case 536: f1(); break;
        case 537: f1(); break;
        case 538: f2(); break;
        case 539: f1(); break;

        case 540: f1(); break;
        case 541: f1(); break;
        case 542: f2(); break;
        case 543: f1(); break;
        case 544: f1(); break;
        case 545: f1(); break;
        case 546: f1(); break;
        case 547: f1(); break;
        case 548: f2(); break;
        case 549: f1(); break;

        case 550: f1(); break;
        case 551: f1(); break;
        case 552: f2(); break;
        case 553: f1(); break;
        case 554: f1(); break;
        case 555: f1(); break;
        case 556: f1(); break;
        case 557: f1(); break;
        case 558: f2(); break;
        case 559: f1(); break;

        case 560: f1(); break;
        case 561: f1(); break;
        case 562: f2(); break;
        case 563: f1(); break;
        case 564: f1(); break;
        case 565: f1(); break;
        case 566: f1(); break;
        case 567: f1(); break;
        case 568: f2(); break;
        case 569: f1(); break;

        case 570: f1(); break;
        case 571: f1(); break;
        case 572: f2(); break;
        case 573: f1(); break;
        case 574: f1(); break;
        case 575: f1(); break;
        case 576: f1(); break;
        case 577: f1(); break;
        case 578: f2(); break;
        case 579: f1(); break;

        case 580: f1(); break;
        case 581: f1(); break;
        case 582: f2(); break;
        case 583: f1(); break;
        case 584: f1(); break;
        case 585: f1(); break;
        case 586: f1(); break;
        case 587: f1(); break;
        case 588: f2(); break;
        case 589: f1(); break;

        case 590: f1(); break;
        case 591: f1(); break;
        case 592: f2(); break;
        case 593: f1(); break;
        case 594: f1(); break;
        case 595: f1(); break;
        case 596: f1(); break;
        case 597: f1(); break;
        case 598: f2(); break;
        case 599: f1(); break;

        case 600: f1(); break;
        case 601: f1(); break;
        case 602: f2(); break;
        case 603: f1(); break;
        case 604: f1(); break;
        case 605: f1(); break;
        case 606: f1(); break;
        case 607: f1(); break;
        case 608: f2(); break;
        case 609: f1(); break;

        case 610: f1(); break;
        case 611: f1(); break;
        case 612: f2(); break;
        case 613: f1(); break;
        case 614: f1(); break;
        case 615: f1(); break;
        case 616: f1(); break;
        case 617: f1(); break;
        case 618: f2(); break;
        case 619: f1(); break;

        case 620: f1(); break;
        case 621: f1(); break;
        case 622: f2(); break;
        case 623: f1(); break;
        case 624: f1(); break;
        case 625: f1(); break;
        case 626: f1(); break;
        case 627: f1(); break;
        case 628: f2(); break;
        case 629: f1(); break;

        case 630: f1(); break;
        case 631: f1(); break;
        case 632: f2(); break;
        case 633: f1(); break;
        case 634: f1(); break;
        case 635: f1(); break;
        case 636: f1(); break;
        case 637: f1(); break;
        case 638: f2(); break;
        case 639: f1(); break;

        case 640: f1(); break;
        case 641: f1(); break;
        case 642: f2(); break;
        case 643: f1(); break;
        case 644: f1(); break;
        case 645: f1(); break;
        case 646: f1(); break;
        case 647: f1(); break;
        case 648: f2(); break;
        case 649: f1(); break;

        case 650: f1(); break;
        case 651: f1(); break;
        case 652: f2(); break;
        case 653: f1(); break;
        case 654: f1(); break;
        case 655: f1(); break;
        case 656: f1(); break;
        case 657: f1(); break;
        case 658: f2(); break;
        case 659: f1(); break;

        case 660: f1(); break;
        case 661: f1(); break;
        case 662: f2(); break;
        case 663: f1(); break;
        case 664: f1(); break;
        case 665: f1(); break;
        case 666: f1(); break;
        case 667: f1(); break;
        case 668: f2(); break;
        case 669: f1(); break;

        case 670: f1(); break;
        case 671: f1(); break;
        case 672: f2(); break;
        case 673: f1(); break;
        case 674: f1(); break;
        case 675: f1(); break;
        case 676: f1(); break;
        case 677: f1(); break;
        case 678: f2(); break;
        case 679: f1(); break;

        case 680: f1(); break;
        case 681: f1(); break;
        case 682: f2(); break;
        case 683: f1(); break;
        case 684: f1(); break;
        case 685: f1(); break;
        case 686: f1(); break;
        case 687: f1(); break;
        case 688: f2(); break;
        case 689: f1(); break;

        case 690: f1(); break;
        case 691: f1(); break;
        case 692: f2(); break;
        case 693: f1(); break;
        case 694: f1(); break;
        case 695: f1(); break;
        case 696: f1(); break;
        case 697: f1(); break;
        case 698: f2(); break;
        case 699: f1(); break;

        case 700: f1(); break;
        case 701: f1(); break;
        case 702: f2(); break;
        case 703: f1(); break;
        case 704: f1(); break;
        case 705: f1(); break;
        case 706: f1(); break;
        case 707: f1(); break;
        case 708: f2(); break;
        case 709: f1(); break;

        case 710: f1(); break;
        case 711: f1(); break;
        case 712: f2(); break;
        case 713: f1(); break;
        case 714: f1(); break;
        case 715: f1(); break;
        case 716: f1(); break;
        case 717: f1(); break;
        case 718: f2(); break;
        case 719: f1(); break;

        case 720: f1(); break;
        case 721: f1(); break;
        case 722: f2(); break;
        case 723: f1(); break;
        case 724: f1(); break;
        case 725: f1(); break;
        case 726: f1(); break;
        case 727: f1(); break;
        case 728: f2(); break;
        case 729: f1(); break;

        case 730: f1(); break;
        case 731: f1(); break;
        case 732: f2(); break;
        case 733: f1(); break;
        case 734: f1(); break;
        case 735: f1(); break;
        case 736: f1(); break;
        case 737: f1(); break;
        case 738: f2(); break;
        case 739: f1(); break;

        case 740: f1(); break;
        case 741: f1(); break;
        case 742: f2(); break;
        case 743: f1(); break;
        case 744: f1(); break;
        case 745: f1(); break;
        case 746: f1(); break;
        case 747: f1(); break;
        case 748: f2(); break;
        case 749: f1(); break;

        case 750: f1(); break;
        case 751: f1(); break;
        case 752: f2(); break;
        case 753: f1(); break;
        case 754: f1(); break;
        case 755: f1(); break;
        case 756: f1(); break;
        case 757: f1(); break;
        case 758: f2(); break;
        case 759: f1(); break;

        case 760: f1(); break;
        case 761: f1(); break;
        case 762: f2(); break;
        case 763: f1(); break;
        case 764: f1(); break;
        case 765: f1(); break;
        case 766: f1(); break;
        case 767: f1(); break;
        case 768: f2(); break;
        case 769: f1(); break;

        case 770: f1(); break;
        case 771: f1(); break;
        case 772: f2(); break;
        case 773: f1(); break;
        case 774: f1(); break;
        case 775: f1(); break;
        case 776: f1(); break;
        case 777: f1(); break;
        case 778: f2(); break;
        case 779: f1(); break;

        case 780: f1(); break;
        case 781: f1(); break;
        case 782: f2(); break;
        case 783: f1(); break;
        case 784: f1(); break;
        case 785: f1(); break;
        case 786: f1(); break;
        case 787: f1(); break;
        case 788: f2(); break;
        case 789: f1(); break;

        case 790: f1(); break;
        case 791: f1(); break;
        case 792: f2(); break;
        case 793: f1(); break;
        case 794: f1(); break;
        case 795: f1(); break;
        case 796: f1(); break;
        case 797: f1(); break;
        case 798: f2(); break;
        case 799: f1(); break;

        case 800: f1(); break;
        case 801: f1(); break;
        case 802: f2(); break;
        case 803: f1(); break;
        case 804: f1(); break;
        case 805: f1(); break;
        case 806: f1(); break;
        case 807: f1(); break;
        case 808: f2(); break;
        case 809: f1(); break;

        case 810: f1(); break;
        case 811: f1(); break;
        case 812: f2(); break;
        case 813: f1(); break;
        case 814: f1(); break;
        case 815: f1(); break;
        case 816: f1(); break;
        case 817: f1(); break;
        case 818: f2(); break;
        case 819: f1(); break;

        case 820: f1(); break;
        case 821: f1(); break;
        case 822: f2(); break;
        case 823: f1(); break;
        case 824: f1(); break;
        case 825: f1(); break;
        case 826: f1(); break;
        case 827: f1(); break;
        case 828: f2(); break;
        case 829: f1(); break;

        case 830: f1(); break;
        case 831: f1(); break;
        case 832: f2(); break;
        case 833: f1(); break;
        case 834: f1(); break;
        case 835: f1(); break;
        case 836: f1(); break;
        case 837: f1(); break;
        case 838: f2(); break;
        case 839: f1(); break;

        case 840: f1(); break;
        case 841: f1(); break;
        case 842: f2(); break;
        case 843: f1(); break;
        case 844: f1(); break;
        case 845: f1(); break;
        case 846: f1(); break;
        case 847: f1(); break;
        case 848: f2(); break;
        case 849: f1(); break;

        case 850: f1(); break;
        case 851: f1(); break;
        case 852: f2(); break;
        case 853: f1(); break;
        case 854: f1(); break;
        case 855: f1(); break;
        case 856: f1(); break;
        case 857: f1(); break;
        case 858: f2(); break;
        case 859: f1(); break;

        case 860: f1(); break;
        case 861: f1(); break;
        case 862: f2(); break;
        case 863: f1(); break;
        case 864: f1(); break;
        case 865: f1(); break;
        case 866: f1(); break;
        case 867: f1(); break;
        case 868: f2(); break;
        case 869: f1(); break;

        case 870: f1(); break;
        case 871: f1(); break;
        case 872: f2(); break;
        case 873: f1(); break;
        case 874: f1(); break;
        case 875: f1(); break;
        case 876: f1(); break;
        case 877: f1(); break;
        case 878: f2(); break;
        case 879: f1(); break;

        case 880: f1(); break;
        case 881: f1(); break;
        case 882: f2(); break;
        case 883: f1(); break;
        case 884: f1(); break;
        case 885: f1(); break;
        case 886: f1(); break;
        case 887: f1(); break;
        case 888: f2(); break;
        case 889: f1(); break;

        case 890: f1(); break;
        case 891: f1(); break;
        case 892: f2(); break;
        case 893: f1(); break;
        case 894: f1(); break;
        case 895: f1(); break;
        case 896: f1(); break;
        case 897: f1(); break;
        case 898: f2(); break;
        case 899: f1(); break;

        case 900: f1(); break;
        case 901: f1(); break;
        case 902: f2(); break;
        case 903: f1(); break;
        case 904: f1(); break;
        case 905: f1(); break;
        case 906: f1(); break;
        case 907: f1(); break;
        case 908: f2(); break;
        case 909: f1(); break;

        case 910: f1(); break;
        case 911: f1(); break;
        case 912: f2(); break;
        case 913: f1(); break;
        case 914: f1(); break;
        case 915: f1(); break;
        case 916: f1(); break;
        case 917: f1(); break;
        case 918: f2(); break;
        case 919: f1(); break;

        case 920: f1(); break;
        case 921: f1(); break;
        case 922: f2(); break;
        case 923: f1(); break;
        case 924: f1(); break;
        case 925: f1(); break;
        case 926: f1(); break;
        case 927: f1(); break;
        case 928: f2(); break;
        case 929: f1(); break;

        case 930: f1(); break;
        case 931: f1(); break;
        case 932: f2(); break;
        case 933: f1(); break;
        case 934: f1(); break;
        case 935: f1(); break;
        case 936: f1(); break;
        case 937: f1(); break;
        case 938: f2(); break;
        case 939: f1(); break;

        case 940: f1(); break;
        case 941: f1(); break;
        case 942: f2(); break;
        case 943: f1(); break;
        case 944: f1(); break;
        case 945: f1(); break;
        case 946: f1(); break;
        case 947: f1(); break;
        case 948: f2(); break;
        case 949: f1(); break;

        case 950: f1(); break;
        case 951: f1(); break;
        case 952: f2(); break;
        case 953: f1(); break;
        case 954: f1(); break;
        case 955: f1(); break;
        case 956: f1(); break;
        case 957: f1(); break;
        case 958: f2(); break;
        case 959: f1(); break;

        case 960: f1(); break;
        case 961: f1(); break;
        case 962: f2(); break;
        case 963: f1(); break;
        case 964: f1(); break;
        case 965: f1(); break;
        case 966: f1(); break;
        case 967: f1(); break;
        case 968: f2(); break;
        case 969: f1(); break;

        case 970: f1(); break;
        case 971: f1(); break;
        case 972: f2(); break;
        case 973: f1(); break;
        case 974: f1(); break;
        case 975: f1(); break;
        case 976: f1(); break;
        case 977: f1(); break;
        case 978: f2(); break;
        case 979: f1(); break;

        case 980: f1(); break;
        case 981: f1(); break;
        case 982: f2(); break;
        case 983: f1(); break;
        case 984: f1(); break;
        case 985: f1(); break;
        case 986: f1(); break;
        case 987: f1(); break;
        case 988: f2(); break;
        case 989: f1(); break;

        case 990: f1(); break;
        case 991: f1(); break;
        case 992: f2(); break;
        case 993: f1(); break;
        case 994: f1(); break;
        case 995: f1(); break;
        case 996: f1(); break;
        case 997: f1(); break;
        case 998: f2(); break;
        case 999: f1(); break;

        default: f3(); 
    }

    return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Zuoliu Ding
Software Developer
United States United States
An Adjunct Faculty and Software Developer in Los Angeles and Orange County, CA
 
* Typical articles published in Dr. Dobb’s Journal and Windows Developer Magazine:

- A Silent Component Update for Internet Explorer
- Silent Application Update
- An MDI-Style Web Browser and Load Spy Monitor
- Implementing Wireless Print for WinNT/Win2K
- Multi-State Checkbox Tree Views
- A Generic Tool Tip Class
- An Easy Way to Add Tool Tips to Any MFC Control

- More from Google...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 19 Dec 2012
Article Copyright 2010 by Zuoliu Ding
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid