Sign in to follow this  
KodeNerd

Return from main

Recommended Posts

The return value from the function you use to spawn an instance of an application - whether one of the exec functions, fork under Unix or CreateProcess under Windows - will either be the exit value from the application or an identifier you can supply to a query function. Given that most of these functions do not wait for the spawned application/process to end, you'll need some way of knowing when it terminates.

Share this post


Link to post
Share on other sites
Quote:
Original post by KodeNerd
I just had a nice idea for a quick program but it depends on running other programs. Is there any way I can tell what the return value from the main function of another program in C++?


If "running other programs" is primarily what it will do, then you almost certainly don't want to use C++ - or any "serious" programming language - for the task. Instead, write a batch (Windows) / shell (Linux) script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this