arguments on command line

Discussion in 'C Programming' started by kanna14243, Nov 15, 2010.

  1. kanna14243

    kanna14243

    Joined:
    Nov 15, 2010
    Messages:
    1
    hiii...

    i need your help guys .. i need to pass a file name as command line argument .. and i have to open that file in the program ...

    if i use ifstream myfile ("example.txt"); the filename has to be pre-defined .. but i want the file name to be passed as command line argument.. ???
    Last edited: Nov 15, 2010
    kanna14243, Nov 15, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Kay
    Replies:
    1
    Views:
    482
    J├╝rgen Exner
    May 18, 2004
  2. Ahmed Moustafa

    Parser for command line arguments?

    Ahmed Moustafa, Aug 21, 2003, in forum: Java
    Replies:
    0
    Views:
    382
    Ahmed Moustafa
    Aug 21, 2003
  3. SC
    Replies:
    2
    Views:
    654
    Michiel Salters
    May 5, 2004
  4. Ashe Corven

    command line arguments

    Ashe Corven, May 8, 2004, in forum: C++
    Replies:
    3
    Views:
    525
    Francis Glassborow
    May 8, 2004
  5. rkoida@yahoo.com
    Replies:
    4
    Views:
    1,706
    Terry Hancock
    Apr 23, 2005
Loading...

Share This Page