Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #60 Read command line argument

Assign to x the string value of the first command line parameter, after the program name.

void main(int argc, char *argv[])
{
    char *x = argv[1];
}

argv[0] would be the program name. See §5.1.2.2.1 Program startup in linked doc n1570.pdf .

New implementation...
< >
programming-idioms.org