Hi,
I'd like to know what's the best practice to create console applications that can accept switches (or keys - I am not sure about the terminology) when called. As an example, consider a simple hello world application that has 3 different outputs:
1. HELLO WORLD
2. hello world
3. Hello World
I want the output be HELLO WORLD if I run helloworld.exe -u, hello world if I run helloworld.exe -l and Hello World if I run helloworld.exe -c.
As an extension, I want to be able to use 2 or more switches/keys, when calling my application. (This might be easy once the first problem is solved!)
Thanks!
2 Replies - 233 Views - Last Post: 02 September 2011 - 12:01 AM
#1
create a console application that gets keys/switches as parameter
Posted 01 September 2011 - 08:59 PM
Replies To: create a console application that gets keys/switches as parameter
#2
Re: create a console application that gets keys/switches as parameter
Posted 01 September 2011 - 09:09 PM
#3
Re: create a console application that gets keys/switches as parameter
Posted 02 September 2011 - 12:01 AM
I think they're called flags if I'm not wrong.
Or Parameters.
Or Parameters.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|