Thread: System call

  1. #1
    Registered User
    Join Date
    Apr 2002

    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

    system("c:\\program.exe 1");
    is there a way to run this when i dont know the number in advance. i tried
    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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 07:18 AM
  3. Inline asm
    By brietje698 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2007, 02: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