Link to home
Start Free TrialLog in
Avatar of HKComputer
HKComputerFlag for United States of America

asked on

Recieving parameters on the command line

I'm trying to program a very elementary program (to work with another software vendors program) that needs to be able to accept two parameters from the command line.  

The instructions I have from the software vendor say: When [TheirSoftware] 'calls' or invokes [MyProgram], it passes two parameters on the command line.  The first parameter is the exact name and path of the [first text file generated by TheirSoftware] and the second paraemter is the exact name and path of the [text file to be passed back to TheirSoftware].

So my program will be invoked like this:

MyProgram c:\somedirectory\original.txt c:\somedirectory\new.txt

How do I read or use the parameters that are being passed to MyProgram?
SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HKComputer

ASKER

I believe that all three of the above answers are correct.  I found the last one the easiest to understand and therefore I used it.  Thanks for you help.