using string with system("") help

This is a discussion on using string with system("") help within the C++ Programming forums, part of the General Programming Boards category; hi im trying to make a program for a friend. He wants it to open up a program when you ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    15

    using string with system("") help

    hi im trying to make a program for a friend. He wants it to open up a program when you enter the parameters for it. So if i entered "C:/somefile.exe" then pressed enter, that file would open. I tried to make a string called prog then i made the user enter where and what the file was called then i did system(prog); but that didnt work. How do i make that work or is there another way to approach this? thnx

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    Code:
    system(prog.c_str());
    Last edited by sand_man; 10-12-2005 at 11:40 PM.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    15
    ill try that thnx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 04-25-2008, 03:45 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Something is wrong with this menu...
    By DarkViper in forum Windows Programming
    Replies: 2
    Last Post: 12-14-2002, 11:06 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 07:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21