Though I'm not sure of what you want to achieve, you can write a small shell script (in Unix) or a batch file in (Windows) with program B called after program A. Since the order of execution is sequential, you'll get what you want.

case 1:
prog_exit=1;
printf("\nWhat is the ip address of the computer you want to steal files from?\n\n",steal);
get_string(steal,SMALL_STR_LEN);
if('\0'== steal[0]) {
printf("\n\nNull value not allowed\n\n");
break;
}
else {
printf("\n\nConnecting to %s...\n",steal);
sleep(5000);
printf("\n\nConnection Successful\n");
sleep(1000);
printf("\n\nWhat is the name of the file you want to steal?\n",name);
get_string(steal,SMALL_STR_LEN);
printf("\nSearching for %s...\n\n",steal);
sleep(6000);
printf("\nSorry, no %s was found on this computer.\n\n",steal);

if(prog_exit == 0) {
printf("\n\nThank you using my program that doesn't do anything. If this program did what it says it does, I wouldn't have written it. Hacking isn't about defacing websites and cracking email accounts. It's about learning. Don't ever deface websites or crash computers, or anything like that. All that will do for you is get you a hefty fine and lots of jail time.%s\n\n",name); {
system("PAUSE");

I want this program (or some kind of pop-up) to come up when you exit program 1.

#include<stdio.h>

int main () {
system("color A");
printf("\n\nThank you using my program that doesn't do anything. If this program did what it says it does, I wouldn't have written it. Hacking isn't about defacing websites and cracking email accounts. It's about learning. Don't ever deface websites or crash a computer, or anything like that. All that will do for you is get you a hefty fine and lots of jail time.\n\n"); {
system("PAUSE");
}
return(0);
}

The program 2 is already part of the first program. So why do you want print the message again. Anyway, if that is what you want, compile both programs, then create a text file as mentioned earlier, with the name of the first executable in the first line and name of the second executable in the next line and name it with a .bat extension. Once the batch file is created, in the command prompt, change directory to where you have created the .bat file and type the name of the batch file. This batch file should run the first program. If the user chooses the option 5, the first program will exit. Now the batch file takes the control and moves to the next line and executes the second program, which prints the message.

suppose you want to launch programB when programA is about to exit.
system() function is used to launch program from inside another program
system ("path_to_program_B");
statement when inserted in program A, will launch programB
be warned, programA will not proceed further from this point until programB finishes and returns. If that behaviour is not desirable, then use fork() followed by exec() on *nix machine and CreateProcess() on windows.

Since you talked about launching on exit, you can put all the actions you want to be performed at exit in a function and register that function using atexit(). This registered function would be invoked when your program is about to exit.

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control. For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…