system() arguments?

This is a discussion on system() arguments? within the C++ Programming forums, part of the General Programming Boards category; What does the system(); command take as an argument? I tried string, but that doesn't exactly work. An array maybe?...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    145

    system() arguments?

    What does the system(); command take as an argument? I tried string, but that doesn't exactly work. An array maybe?
    "Um...well..."
    -Kyoto Oshiro

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    It takes a character array.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,088
    If you have a string just use .c_str():

    std::string command("pause");
    system(command.c_str());

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    145

    Thumbs up Thanks!

    Works like a charm, thanks a bunch!
    "Um...well..."
    -Kyoto Oshiro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  2. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 04:35 PM
  3. New system build wont boot
    By lightatdawn in forum Tech Board
    Replies: 7
    Last Post: 12-02-2005, 05:58 AM
  4. BIOS system and memory allocation problem
    By beely in forum Tech Board
    Replies: 9
    Last Post: 11-25-2003, 06:12 AM
  5. Problem Reporting System. Need Advide!
    By brunomiranda in forum Tech Board
    Replies: 9
    Last Post: 09-25-2003, 09:21 PM

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