Thread: System Calls && Variables

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    387

    System Calls && Variables

    is it possible to have a system call that has a variable in it?
    eg. if the system call had parameters and you needed input from a user for those parameters?

    ie: "g++ main.cpp -o main.exe"

    If it is possible can you tell me how to do it?
    thanks

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    system() will NOT interpret anything other than a string,

    input the variables and compile them into a string using

    int sprintf( char *buffer, const char *format [, argument] ... );
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    what header file is system(); declared in?

  4. #4
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    its probably compiler dependant, try stdlibh.or process.h
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    ok thanks that worked
    (stdlib.h)

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    Steven? you didn't know that man?

    everyone knows that you need stdlib.h to use the system() function

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    lol shaddap :-P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 09-30-2008, 02:12 AM
  2. about system calls
    By fnoyan in forum C Programming
    Replies: 1
    Last Post: 02-27-2006, 06:25 AM
  3. Operating system construction
    By AdamLAN in forum Tech Board
    Replies: 7
    Last Post: 03-05-2005, 01:31 PM
  4. C++ and Java System Calls
    By Korn1699 in forum Linux Programming
    Replies: 5
    Last Post: 12-10-2004, 03:31 AM
  5. Putting variables in SYSTEM
    By mycro in forum C++ Programming
    Replies: 3
    Last Post: 05-29-2003, 07:59 PM