question abt function system();

This is a discussion on question abt function system(); within the C Programming forums, part of the General Programming Boards category; Hi, i have this problem.. i just started to program in C, i programmed a little bit in C++, so ...

  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,796
    >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, 02:07 AM
  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. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  4. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  5. Replies: 3
    Last Post: 06-13-2005, 07:28 AM

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