My program isn't accepting the filename I give on the command line. For
example, when I type "./a.out darwin.txt" it doesn't do anything.
Write a small test program that does nothing but prints the command-line
arguments to std-out one argument per line:
$ ./a.out darwin.txt
darwin.txt
$ ./a.out hello world
hello
world
$
If you can get that to work, modify your test program to treat each
command-line argument as a file name: have your program open the file and
write the file's contents to std-out. If you can do that, you should be good
to go. If you can't, let me know and we'll work through it.
In general, it's a good idea to get in the habit of writing small programs to
test some aspect of a language or a system that you're having trouble
understanding.
Received on Mon Feb 26 2007 - 12:33:08 EST
This archive was generated by hypermail 2.2.0 : Tue Feb 27 2007 - 12:27:32 EST