Connecting Tech Pros Worldwide Forums | Help | Site Map

catch the return value of int

srinath duraisamy
Guest
 
Posts: n/a
#1: Aug 13 '07


Hi

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

Regards
Srinath.D


Victor Bazarov
Guest
 
Posts: n/a
#2: Aug 13 '07

re: catch the return value of int


srinath duraisamy wrote:
Quote:
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


Tim Slattery
Guest
 
Posts: n/a
#3: Aug 13 '07

re: catch the return value of int


srinath duraisamy <srinathduraisamy.lcs@gmail.comwrote:
Quote:
>
>
>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
Slattery_T@bls.gov
http://members.cox.net/slatteryt
Siddharth Jain
Guest
 
Posts: n/a
#4: Aug 14 '07

re: catch the return value of int


On Aug 13, 6:10 pm, Tim Slattery <Slatter...@bls.govwrote:
Quote:
srinath duraisamy <srinathduraisamy....@gmail.comwrote:
>
Quote:
Hi
>
Quote:
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.

Closed Thread