hi!
I have a problem with argv input parameter. I have 5 input parameters. But sometime I only need four of them (first, second, fourth and fifth). How can I exclude the third parameter?
hi!
I have a problem with argv input parameter. I have 5 input parameters. But sometime I only need four of them (first, second, fourth and fifth). How can I exclude the third parameter?
Current projects:
1) User Interface Development Kit (C++)
2) HTML SDK (C++)
3) Classes (C++)
4) INI Editor (Delphi)
I'm assuming you're using a loop to access them:
Code:int a; for(a = 0; a < argc; a = ( ++a == 2 ? ++a : a ) ) { }
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Does your compiler have getopt() ? It's a useful function for accessing command line args. If you don't have it, you may be able to find the source on the web. (There are examples of its use on the forums here)
Alternatively, check each command line options manually yourself. It's best to adopt an approach that means invoking your program something like this:
>myprog.exe -aONE -bTWO -c
then you can go:
>myprog.exe -aONE -c
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]