catch the return value of int

S

srinath duraisamy

Hi

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

Regards
Srinath.D
 
V

Victor Bazarov

srinath said:
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
 
T

Tim Slattery

srinath duraisamy said:
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.
 
S

Siddharth Jain

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top