cout
output is sent to a Command Prompt window, which disappears after your program terminates.
However, I need to be able to see the output of your program.
I am assuming you are running Code::Blocks; but the approach is similar for Dev/C++ as well.
Edit
menu item-- exposing the edit submenu and click the Select All
sub menu item
(click image to enlarge):
Enter>
key on the keyboard-- the highlighting will go away. The contents of the window has now been copied
:
- Create a new (empty) file in the CodeBlocks editor, and paste (either
Ctl-v
or
Edit
/Paste
) the content sof the window you've copied into the empty file.
- Save the file (suggestion-- use a file extension of
.txt
-- e.g. output.txt
), and
you're all set to go.