Thread: using string with system("") help

  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 10: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, 02: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, 06:49 PM