Sponsored Content
Full Discussion: exit in cpp
Top Forums Programming exit in cpp Post 302345201 by Leppie on Tuesday 18th of August 2009 04:39:17 PM
Old 08-18-2009
Quote:
Originally Posted by lipun4u
yes....but atexit() does not take any arguments.
atexit() does take arguments as it calls a function when exiting the program, however the called function cannot return arguments. Have a look at this page.

If you want your program to return a value, you could try the _exit() function. More info here.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Hi Modem Problem And cpp

Hi am very new to unix.I got installed linux mandrake and the first problem is whith the modem i don't know why but it does not work. i config it on /dev/modem and some time it says "the modem is bussy" and some time it says: "Modem ready" but the modem did'n switch on Ok the other question... (3 Replies)
Discussion started by: user666
3 Replies

2. Programming

cpp in unix

sir i am trying to compile and execute cpp file in unix the command cpp <filename > is not working do you suggest any other command? thanking you (5 Replies)
Discussion started by: sandhyapidugu
5 Replies

3. UNIX for Dummies Questions & Answers

Where can I find a list of exit codes? (Exit code 64)

I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies

4. Programming

gcccommand found how to do with cpp

gcc help iam using kubuntu os (www.ubuntu.com) in that i dont find gcc but cpp command is there how to compile code with that & how to use gij for java in ubuntu (1 Reply)
Discussion started by: seshumohan
1 Replies

5. Shell Programming and Scripting

If file = .cpp then print?

I'm trying to develop a script that makes it so only .cpp programs can print. I'm doing it for my computer programming class because everyone keeps printing the executable instead of the source code and it's wasting a lot of paper. How can I accomplish this? Thanks for the help. :D (5 Replies)
Discussion started by: Irish_Cereal
5 Replies

6. Shell Programming and Scripting

reading a cpp file

I need to find all the methods in a cpp file ... using shell script Pls guide me regarding the grep criteria for searching methods I mean what are the patterns to be grepped in *.cpp which match methods Hope i have made myself clear Thanks and Regards -- Ultimatix (2 Replies)
Discussion started by: ultimatix
2 Replies

7. Shell Programming and Scripting

CPP to PERL

Hi all, can we convert a cpp program to perl scripting ? (4 Replies)
Discussion started by: Shell_Learner
4 Replies

8. Programming

.h or .cpp

I have the code below and cannot decide if to put it in a .h file or in a .cpp file #ifndef VERBOSE_H #define VERBOSE_H #include "sstring.h" enum Verbose { none = 0, low = 1, medium = 2, high = 3, diag = 4 }; bool GetVerbose(String& S, Verbose& V) { S.ToUpper(); if (S ==... (3 Replies)
Discussion started by: kristinu
3 Replies
explain_exit(3) 					     Library Functions Manual						   explain_exit(3)

NAME
explain_exit - print an explanation of exit status before exiting SYNOPSIS
#include <libexplain/libexplain.h> void explain_exit_on_exit(void); void explain_exit_on_error(void); void explain_exit_cancel(void); DESCRIPTION
The explain_exit_on_exit function may be used to have the calling program print an explanation of its exit status (the value passed to exit(3) or the return value from main) immediately before it terminates. The explain_exit_on_error function may be used to have the calling program print an explanation of its exit status immediately before it terminates, if that exit status is not EXIT_SUCCESS. The explain_exit_cancel function may be used to cancel the effect of the explain_exit_on_exit or explain_exit_on_error function. These functions may be called multiple times, and in any order. The last called has precedence. The explanation will never be printed more than once. Call Exit As Normal In order to have the explanation printed, simply call exit(3) as normal, or return from main as normal. Do not call any of these functions in order to exit your program, they are called before you exit your program. Caveat This functionality is only available on systems with the on_exit(3) system call. Unfortunately, the atexit(3) system call is not suffi- ciently capable, as it does not pass the exit status to the registered function. SEE ALSO
exit(3) cause normal process termination atexit(3) register a function to be called at normal process termination on_exit(3) register a function to be called at normal process termination COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_exit(3)
All times are GMT -4. The time now is 12:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy