0

I'm just getting started in C so I know next to nothing. I've gone through a few tutorials already but my knowledge is still very basic.

I can run my program by typing ./main in my terminal. Now I want to make it so that when I type ./main --version, the terminal outputs the version as a string.

I reckon I have to create a new argument in the argv vector, but I'm entirely not sure about it. I'd be very thankful if anyone could give me a hint.

Robson
  • 23
  • 3
  • I went to www.google.com and typed "how to use command line arguments in c". Then there were code examples! – Lundin Nov 25 '22 at 13:43

0 Answers0