Re: The difference between return and exit()?
From: Måns Rullgård (mru_at_mru.ath.cx)
Date: 09/28/04
- Next message: rc: "Re: Unix Password Encryption Procedure"
- Previous message: learning_C++: "The difference between return and exit()?"
- In reply to: learning_C++: "The difference between return and exit()?"
- Next in thread: Alex Vinokur: "Re: The difference between return and exit()?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Sep 2004 10:38:02 +0200
learning_c@hotmail.com (learning_C++) writes:
> Hi,
> I often see the functions like exit() and close(). Can they replace
> return in the c program? Which header includes them?
> What is the difference between exit(0), exit(1) and exit(...)?
> Please give me some examples.
exit() causes the program to exit with the argument as return value.
The return statement only returns from a function to its caller. In
main(), this amounts to exiting the program. close() is for closing
files opened with open().
Use the command "man" to view the manual for these function. Running
"man exit" will give information on the exit() function, etc.
-- Måns Rullgård mru@mru.ath.cx
- Next message: rc: "Re: Unix Password Encryption Procedure"
- Previous message: learning_C++: "The difference between return and exit()?"
- In reply to: learning_C++: "The difference between return and exit()?"
- Next in thread: Alex Vinokur: "Re: The difference between return and exit()?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|