Thread: Using variables in system()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    12

    Unhappy Using variables in system()

    Is there some way to use variables in a system() command?

    i've tried

    Code:
    system("%s",firstprogrampath);
    but i only get an errormessage in the stdlib.h header (line 356), too many arguments in 'int system (const char*)'

    as well in the actual program

    (line 107) at this point in file.

    So, is there any way to use variables in system();?

    edit: also, firstprogrampath[50]; is a char variable. (string variable, i think the real name is?)
    Last edited by Afro; 07-02-2007 at 06:37 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  2. Replies: 3
    Last Post: 06-13-2005, 07:28 AM
  3. Why Can't C++ Be Used to Develop Operating System?
    By Antigloss in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2005, 06:16 AM
  4. Putting variables in SYSTEM
    By mycro in forum C++ Programming
    Replies: 3
    Last Post: 05-29-2003, 07:59 PM
  5. System Calls && Variables
    By Okiesmokie in forum C++ Programming
    Replies: 6
    Last Post: 03-06-2002, 09:10 PM