QP School
Command-Line Arguments in C - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: C 18 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=32)
+--- Thread: Command-Line Arguments in C (/showthread.php?tid=5105)



Command-Line Arguments in C - Qomplainerz - 07-25-2023

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;
}