QP School

Full Version: Command-Line Arguments in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Command-line arguments allow passing arguments to a C program when executing it from the terminal.

int main(int argc, char *argv[]) {
    if (argc > 1) {
        printf("First argument: %s\n", argv[1]);
    }
    return 0;
}