Thread: question abt function system();

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    question abt function system();

    Hi,

    i have this problem.. i just started to program in C, i programmed a little bit in C++, so here is my question..

    i must write a function which when executes ends the program saying "Press any key to continue.."...

    In C++ that function was system("pause"); but in C it doesnt work.. i hope u guys can help me


    Thanks in advance

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but in C it doesnt work..
    Then you used it wrong. Did you include stdlib.h? Also, have you looked at our FAQ and read why this is a ........ poor reason to use the system function?
    My best code is written with the delete key.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Is "pause" a valid command on the OS you're running now?
    system( "pause" ); is OS specific. Check the FAQ.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 05:35 PM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  5. Replies: 3
    Last Post: 06-13-2005, 07:28 AM