I want to set arguments to c Program like this.
$./Program_name -a 100 -b 5 -c 30
and I want to use this value a
, b
, c
in the program.
For ex:
int count = a;
int number = b;
int limit_exec = c;
I don't know how it works. I couldn't find it in Google... I'd like to see some examples.
Also, in the same time, I want to make default and limits of values.
Set limits like this: Value
a
can only have a number from 1 to 10000.Using default when I didn't put value like this:
$./program -a 100 -c 30 // then value 'b' should use default number.
I don't know how to set default. Is it okay to set default at c code like this?
#define a 50 #define b 100 #define c 30