By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

catch the return value of int

P: n/a


Hi

Is there any way to catch the return value of the main program?

Regards
Srinath.D

Aug 13 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
srinath duraisamy wrote:
Is there any way to catch the return value of the main program?
That's OS-dependent. Your debugger should be able to tell you, or
the OS can have a mechanism similar to DOS' "errorlevel", or you
could execute the process (using whatever means your OS provides)
and that should have the ability to capture the return value of
the process when it exits (that's how the debugger does it, BTW).
You need to ask in the newsgroup for your OS (or just RTFM).

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 13 '07 #2

P: n/a
srinath duraisamy <sr******************@gmail.comwrote:
>

Hi

Is there any way to catch the return value of the main program?
Yes, many operating systems can catch that value and test it in a
scripting language. Shell scripting languages in Unix can do it. the
batch language in WinXP can do it.

You might want to tell us more about what you're trying to accomplish,
then we might be able to point you in the right direction.

--
Tim Slattery
Sl********@bls.gov
http://members.cox.net/slatteryt
Aug 13 '07 #3

P: n/a
On Aug 13, 6:10 pm, Tim Slattery <Slatter...@bls.govwrote:
srinath duraisamy <srinathduraisamy....@gmail.comwrote:
Hi
Is there any way to catch the return value of the main program?
main is called by OS so it returns valur to OS. if you want to know
what it's returning, you can cout before returning.

Aug 14 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.