Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

The difference between return and exit()?
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.

Thanks,

Report this thread to moderator Post Follow-up to this message
Old Post
learning_C++
09-28-04 02:04 PM


Re: The difference between return and exit()?
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

Report this thread to moderator Post Follow-up to this message
Old Post
Måns Rullgård
09-28-04 02:04 PM


Re: The difference between return and exit()?
"learning_C++" <learning_c@hotmail.com> wrote in message news:44bd0859.0409280026.16dfcd53@
posting.google.com...
> 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.
>
> Thanks,

The difference between return, exit() and abort() in C++ program can be seen
 at
http://groups.google.com/groups?sel...p1.dejanews.com

--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn




Report this thread to moderator Post Follow-up to this message
Old Post
Alex Vinokur
09-28-04 09:12 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:36 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.