Thread: program closes fast

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2

    program closes fast

    alrite in C++ theres system("PAUSE"); to make the program not close as soon as its run but what can i use in C to make sure the program doesnt close imediately after its run?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Same thing will work.

    gg

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    75
    yeah same thing will work in c as well
    just make sure you have stdlib.h included in the program

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2
    alrite, it works fine even without stdlib.h but it keeps on going forever...see this is my first C prog..it says "blahblah blah" but it goes on forver..now if i want it to say it once then stop what would i do..o_O i think i should get a book instead of internet tutorials...

  5. #5
    Registered User Twiggy's Avatar
    Join Date
    Oct 2001
    Posts
    43
    I always just add a getch(); at the end and tell them to hit any button to end the program. Crude, but it works fine for me.

  6. #6
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    Originally posted by MrSoy
    alrite, it works fine even without stdlib.h but it keeps on going forever...see this is my first C prog..it says "blahblah blah" but it goes on forver..now if i want it to say it once then stop what would i do..o_O i think i should get a book instead of internet tutorials...
    What goes on forever? The display of blah blah blah? The program doesn't terminate?

    Post some code as you may have an infinite loop.
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  2. making a program leave a msg for background program when it closes
    By superflygizmo in forum Windows Programming
    Replies: 2
    Last Post: 02-06-2006, 07:44 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. program open and closes
    By Musicdip in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 06-27-2002, 04:34 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM