Aug 11, 2010 at 3:01am Aug 11, 2010 at 3:01am UTC
Don't forget to #include <fstream>
!!! ;)
Last edited on Aug 11, 2010 at 3:03am Aug 11, 2010 at 3:03am UTC
Aug 11, 2010 at 6:23am Aug 11, 2010 at 6:23am UTC
You aren't passing any command line arguments.
Aug 11, 2010 at 6:26am Aug 11, 2010 at 6:26am UTC
How do I do that?
I'm running Ubuntu Linux and from the command line I do: g++ <filename> -o test
then: ./test
then i get the "Usage: argv[0] <infile>" message , but how do i pass command line arguments?
Aug 11, 2010 at 6:31am Aug 11, 2010 at 6:31am UTC
./test <command line arguments>
Aug 11, 2010 at 6:37am Aug 11, 2010 at 6:37am UTC
I did: ./test testFile ch17_name.cpp
and still got: Usage: argv[0] <infile>
Aug 11, 2010 at 9:28am Aug 11, 2010 at 9:28am UTC
The name of the program is the first argument, so you're giving 3 when you expect 2.
Don't just copy paste
Aug 11, 2010 at 9:13pm Aug 11, 2010 at 9:13pm UTC
Thanks that worked fine :)
Last edited on Aug 11, 2010 at 9:21pm Aug 11, 2010 at 9:21pm UTC