I am trying to use file name as a parameter to a program in DOS.

I know it can be done by changing the parameter to the main().

I do not understand the exact way.

I have developed a data compression and decompression utility, it works for a particular file name but I want to make it more user friendly.

Looking forward to get some help.

Recommended Answers

All 3 Replies

You mean something like this: int main(int argc, char *argv[]) ?
If so, google: c++ int main parameters for more info.

or a better search term is: command line arguments

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.