Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Command-Line Arguments in C
#1
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;
}
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multi-line comments in C Qomplainerz 0 335 07-26-2023, 07:24 AM
Last Post: Qomplainerz
  Commenting out a part of a line in C Qomplainerz 0 340 07-26-2023, 07:19 AM
Last Post: Qomplainerz
  Single-Line comments in C Qomplainerz 0 339 07-26-2023, 07:16 AM
Last Post: Qomplainerz
  Function arguments and return values in C Qomplainerz 0 218 07-25-2023, 11:02 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 7 Guest(s)