Results 1 to 3 of 3

Thread: concatenate argv

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471

    concatenate argv

    What's the best way to concatenate the argv parameter of the
    main function in order to build a full path name with spaces in it?

    eg.
    MyProgram.exe C:\Base Directory\Directory 2\Filename w spaces.txt

    in this example, argc would equal 6. I would like to concatenate
    all the argv's in order to build one large string. What's the best
    way to do this?

    Thanks
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    nm, i developed a quick way to do it

    thx anyways
    Bababooey
    Tatatoothy
    Mamamonkey

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The best way is just to surround the path name in quotes, and then it will automatically end up as a single string:
    Code:
    MyProgram.exe "C:\Base Directory\Directory 2\Filename w spaces.txt"
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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