Let's say we have a (fictional) requirement: From within our C code, we must execute the program /projectx/do_this_now passing along three parameters: -1, 0 and 55. Like so:
/projectx/do_this_now -1 0 55
Recall the syntax of the exec API:
execl(const char *pathname_to_successor_program, const char *argv0, const char *argv1, ..., const char *argvn, (char *)0);
So, it seems quite trivial; let's do it:
execl("/projectx/do_this_now", "do_this_now", -1, 0, 55, (char *)0);
Whoops! The compiler will, or could, interpret the second argument to the successor 0 (after the -1) as the NULL terminator, and would therefore not see the following argument 55.
Fixing this is easy; we just have to remember that each argument to ...