Read the keyboard buffer and terminate
Listing 4 blocks and waits for the user to press a key on the keyboard
Listing 4. Read the keyboard buffer and terminate.
//Block and wait until the user presses a key. readkey(); //Destroy bitmaps to avoid memory leaks. destroy_bitmap(picA); destroy_bitmap(picB); return 0;//Return 0 to indicate a successful run. }//end main function END_OF_MAIN() |
When the user presses any key, the program destroys the two memory bitmaps and terminates.