Thread: passing arguments using "Command Line Arguments"

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    21

    passing arguments using "Command Line Arguments"

    I want to call my image using command line arguments. But my images are stored somewhere in different folder at "command prompt".

    The location of the image may look like this: "Files\IrfanView>i_view32.exe c:\*.bmp /convert=c:\*.pgm".
    I tried to copy this entire location name into my C++_ Command Line Argument. But looks like the path is not read .. .

    Any help/advise will be helpful.
    Thanks

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Launch a command prompt by clicking Start->All Programs->Accessories->Command prompt, cd to the directory your program is stored in, and run it with text after the name:
    Code:
    C:\>cd "Documents and Settings\user\My Documents"
    C:\Documents and Settings\user\My Documents>program stuff
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Passing arguments
    By jcafaro10 in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2009, 01:14 PM
  2. Passing arguments.
    By omnificient in forum C Programming
    Replies: 3
    Last Post: 05-28-2008, 02:41 PM
  3. Passing arguments between functions
    By Wiretron in forum C Programming
    Replies: 4
    Last Post: 05-17-2006, 04:59 PM
  4. Passing arguments to script.....
    By suwie in forum C Programming
    Replies: 5
    Last Post: 09-25-2004, 11:10 PM
  5. passing arguments
    By Baard in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2003, 08:10 AM