exit()

This is a discussion on exit() within the C++ Programming forums, part of the General Programming Boards category; Hey everyone, I read this line of code in a book: Code: if (denominator == 0) { cout << "Illegal ...

  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-09-2009, 11:35 PM
  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, 06: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

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