System call

This is a discussion on System call within the C Programming forums, part of the General Programming Boards category; i have a .exe file i need to run from within my c program. the .exe has to have a ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    17

    System call

    i have a .exe file i need to run from within my c program. the .exe has to have a number after it so i use

    Code:
    system("c:\\program.exe 1");
    is there a way to run this when i dont know the number in advance. i tried
    Code:
    system("c:\\program.exe %d",num);
    This does not work.
    any ideas
    When i find myself in times of trouble. mother mary comes to me, speaking words of wisdom, let it be C

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    FAQ
    Consider using sprintf() to create a command
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 09:25 AM
  2. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 06:18 AM
  3. Inline asm
    By brietje698 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2007, 01:54 PM
  4. nanosleep() -system call does some confusing things
    By jtk in forum Linux Programming
    Replies: 5
    Last Post: 08-30-2007, 04:15 AM
  5. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM

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