Example: const

In the following example, const modifies a formal parameter of a function declaration. An actual parameter passed as i cannot be modified by the function my_itoa.

/* Function description: my_itoa converts the integer i to a string s */
    char * my_itoa( const int i, char * s) {         sprintf (s, "%d", i);         return s;     }
    int x = 5;
    char str[16];
    my_itoa(x, str);
    lr_output_message ("my_itoa returned %s", str);
Output:
Action.c(8): my_itoa returned 5