The simplest way to run something after main
ends in a C++ program, is to do it in the destructor of a static object.
If you're talking about after the program terminates, then that is wholly outside the realm of standard C++. You'd have to use OS-specific means for that. However, the simplest then (assuming you need the whole thing to happen automatically) is to invoke your program via a command or script that runs first your program, and then the second program.