You are not logged in.
Pages: 1
Topic closed
I am using getopt() and a switch to parse my input, as shown over at:
http://www.gnu.org/s/libc/manual/html_n … -of-Getopt
I have read about parsing, but I can't parse something the way I want. I want to have a final variable on the command line.
For example: $programname -a -d 4560
However the 4560 is _not_ related to -a or -d, it is entirely on its own and it must come last. I am not sure how I would 'catch' the argument in a switch, and how I could ensure it's the final argument?
My string const in getopt() is like this: "a:d::"
a requires an argument, -d is optional, but now I need a final integer value that doesn't have a flag, just a number... any ideas?
Offline
Closing duplicate....
Follow discussion here
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Pages: 1
Topic closed