Thread: prevent exiting

  1. #1
    Unregistered
    Guest

    prevent exiting

    Is there a way to prevent ctrl c from exiting my program?

  2. #2
    Registered User cody's Avatar
    Join Date
    Sep 2001
    Posts
    86
    Hi,

    yes, there is a way. You'll have to install your own signal handler by using the signal() function.

    enjoy
    cody
    #include "reallife.h"

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Why?

    Why would you like to do that? If you happen to get into an infinite loop when testing the program, it won't be fun...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    yeah, but if you really do have bulletproof code, that would never happen... plus, if you are coding over a windows environment, you could alt-tab to the rescue... [you'd have to mask those as well... or have a preset PIF disabling those shortcuts...]... if you really want to usurp it, i'd recommend you do it very last...
    hasafraggin shizigishin oppashigger...

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Is there an echo in here..................?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exiting the program.
    By Taka in forum C Programming
    Replies: 6
    Last Post: 10-14-2007, 09:24 AM
  2. Best way to prevent buffer-overflow
    By Siphon in forum C Programming
    Replies: 1
    Last Post: 01-01-2007, 11:53 AM
  3. How to prevent a function from being overriden?
    By thomas_nibu in forum C++ Programming
    Replies: 18
    Last Post: 11-13-2005, 09:55 PM
  4. prevent char input from int
    By SuperNewbie in forum C Programming
    Replies: 1
    Last Post: 04-08-2004, 02:35 AM
  5. How to prevent exiting from running program
    By scorpio_IITR in forum Linux Programming
    Replies: 5
    Last Post: 01-18-2004, 04:15 AM