Thread: exit()

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    153

    exit()

    Hey everyone,
    I read this line of code in a book:
    Code:
    if (denominator == 0)
    {  
        cout << "Illegal fraction: division by 0";  
        exit(1); 
    }
    and I was just wondering what exit(1) does? I mean I understand from using the code that it exits out of the function before it's done...but what exactly is it doing under the hood? Any insight is always cool, there are probably a lot more people w/ more urgent topics
    peace, Chap

  2. #2

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    153
    thanks

  4. #4
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    You're welcome. Those two sites are chock full of reference material for C++ functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Chat Program Help?
    By Paul22000 in forum Networking/Device Communication
    Replies: 9
    Last Post: 02-10-2009, 12:35 AM
  2. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  3. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  4. Dynamic array of pointers
    By csisz3r in forum C Programming
    Replies: 8
    Last Post: 09-25-2005, 02:06 PM
  5. exit() ?
    By smd in forum C++ Programming
    Replies: 4
    Last Post: 06-26-2002, 04:31 PM