FileName as CommandLineArgument
-
How to pass a file name as command line argument in main function?
-
How to pass a file name as command line argument in main function?
If you run your program from the console and type in the filename as in myprog.exe myfile.xt it will be passed in
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
If you run your program from the console and type in the filename as in myprog.exe myfile.xt it will be passed in
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
i am NOT running it from console. i have to run it in windows mode. A sample code would help me better.Could u please?
-
i am NOT running it from console. i have to run it in windows mode. A sample code would help me better.Could u please?
There is no code to pass the filename, it has to be passed as a parameter. I think it's the same for windows apps. The string collection passed into your static void main contains the arguments. To pass it in, it needs to be an argument when the program is run. Or do you mean something else ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
There is no code to pass the filename, it has to be passed as a parameter. I think it's the same for windows apps. The string collection passed into your static void main contains the arguments. To pass it in, it needs to be an argument when the program is run. Or do you mean something else ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
i am trying and hope i will get it soon. And will get back to u if i need...