Connecting Tech Pros Worldwide Forums | Help | Site Map

Command line arguments

Newbie
 
Join Date: Jun 2007
Posts: 1
#1: Jun 17 '07
Write a professional C program that will print out all command line arguments that start with a '-'.

The program should also set a boolean variable to true if a command line argument is found that is equal to "-d" exactly, or to false if it is not found.

Finally, the program should then print out the value of that boolean variable.

Savage's Avatar
Expert
 
Join Date: Feb 2007
Posts: 1,737
#2: Jun 17 '07

re: Command line arguments


Quote:

Originally Posted by chilo

Write a professional C program that will print out all command line arguments that start with a '-'.

The program should also set a boolean variable to true if a command line argument is found that is equal to "-d" exactly, or to false if it is not found.

Finally, the program should then print out the value of that boolean variable.

Ok,so what have you tryed?

And please read posting guidelines, when you have time, they will help you to get answer to your questions a way more faster.


Savage
Familiar Sight
 
Join Date: Feb 2007
Location: Toronto Ontario
Posts: 211
#3: Jun 18 '07

re: Command line arguments


Quote:

Originally Posted by chilo

Write a professional C program that will print out all command line arguments that start with a '-'.

The program should also set a boolean variable to true if a command line argument is found that is equal to "-d" exactly, or to false if it is not found.

Finally, the program should then print out the value of that boolean variable.

I don't know any professional that would write this program :P
Savage's Avatar
Expert
 
Join Date: Feb 2007
Posts: 1,737
#4: Jun 18 '07

re: Command line arguments


Quote:

Originally Posted by Silent1Mezzo

I don't know any professional that would write this program :P

LOL.

Savage
Reply