A C or C++ program can return an integral value to the operating system when program execution terminates. This value is the program's return code. If you launch the program from a batch file, you can check the return code in the batch file with the IFErrorLevel command. For more information on batch files and commands you can use in them, check the help included in your operating system.
On the OS/2 command line, you can get the return code
using the SET PROMPT $r command.
Some programs do not return a value, and their return codes are not defined. Most VisualAge C++ programs use much more flexible and powerful methods than integer return codes, such as signal and exception handling, to deal with exceptional circumstances that can occur during program execution.
![]()
Signals
and Exceptions
Signal
and Exception Handling
![]()
Run Your Application
Return a Value from
an Application
![]()
Structured
Exception Handling (C)
