W
willmann817
when the user runs my program from the command line I require them to type
myProgram -k <some_value>
<some_value> needs to be a positive integer between 1 and 100. How do I assure they do not type in a string or something like that. Here is what I have so far but I am not sure what to do from here?
int main(int argc, char *argv []){
//Getting command line arguments using getopt.
while((ch = getopt(argc, argv, "k:m:s")) != EOF){
switch(ch){
case "k":
if
}
}
}
myProgram -k <some_value>
<some_value> needs to be a positive integer between 1 and 100. How do I assure they do not type in a string or something like that. Here is what I have so far but I am not sure what to do from here?
int main(int argc, char *argv []){
//Getting command line arguments using getopt.
while((ch = getopt(argc, argv, "k:m:s")) != EOF){
switch(ch){
case "k":
if
}
}
}