Results 1 to 2 of 2

Thread: fstream and argv[]

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    1

    fstream and argv[]

    Hi
    i was wondering how you would go about reading files passed in the command line. i don't know how many files there are. also is it possible to read in a string first and then a series of integers.
    thanks for any help
    Morgan

  2. #2
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Well, if you do
    Code:
    int main(int argc, char* argv[])
    argc is the number of arguments passed (0 is the program name). You could use that to see how many files were passed.
    Alcohol & calculus don't mix.
    Never drink & derive.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width