-
Command Line Arguement
hi
I m creating a C++ program in Visual C++ 6.0 based on file handling!!
What I want to do is, I want the user to mention the file name during the command line thing!!
i..e if the user types: cl problem1 history.txt
My program opens the history.txt file in reading mode.
The thing is how do I, take this filename as arguement in my program!!
thnx
-
Search your help files for ARGV and ARGC... That'll point your nose in the right direction :D
-
hi SirDice
thnx for putting me on the right direction!!
Now, I have created a C++ program in Visual C++ 6.0.
Can u tell me the exact steps that I need to take, so as to be able to execute my program thru the command line.
Thnx
-
Step 1 - Learn to use google
Step 2 - Learn C++
Parsing out arguments given via the command line is usually one of the first few chapters of any book on c++ programming. Finding a tutorial on doing it should be trivial via google.
-
I thought Visual C++ would have had plenty of examples on how to use argv and argc.. but anyway.. google throws up plenty indeed.. first hit http://www.google.com/search?hl=en&l...2B&btnG=Search
-
thnx all of u for the above assistance.
SirDice, the link really helped, thnx a lot!!