I haven't ever used CLA so I had to ask.

For simplicity sake, Say I have a program that takes in at most 5
arguments. The arguments from args[1] - args[4] has to be some numbers.

These number will be used for something, say to calculate its
average.

How could I use the cmd, to access the CLA and pass it
args[0] through args[4] and execute the .exe of that c++ program.

I searched for it, but didn't find anything specific.

Recommended Answers

All 2 Replies

I haven't ever used CLA so I had to ask.

For simplicity sake, Say I have a program that takes in at most 5
arguments. The arguments from args[1] - args[4] has to be some numbers.

These number will be used for something, say to calculate its
average.

How could I use the cmd, to access the CLA and pass it
args[0] through args[4] and execute the .exe of that c++ program.

I searched for it, but didn't find anything specific.

If you have a program called calcAverage.exe (in Windows) and you wanted to average 5 10 15 20, do this on the command line:

calcAverage 5 10 15 20

In Linux, if the executable is called calcAverage.x, do this:

./calcAverage.x 5 10 15 20

Oh that was easy. Thanks bro.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.