07-25-2023, 01:27 PM
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;
}
int main(int argc, char *argv[]) {
if (argc > 1) {
printf("First argument: %s\n", argv[1]);
}
return 0;
}