Share this page

# Example: default

In the following example, control passes to the default statement because the variable menu, whose value is 4, does not appear in any specific case statement.

        int menu = 4;
        switch(menu) {
        case 1:
            lr_output_message ("Option 1");
            break;

        case 2:
            lr_output_message ("Option 2");
            break;

        case 3:
            lr_output_message ("Option 3");
            break;

        default:
            lr_output_message ("Invalid option selected\n");
    }

    Example: Output:
    Action.c(16): Invalid option selected

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: