CPSC 421-020 Object-Oriented Programming Spring 2026

Exercise 10: IOBuffering Posted: Jan 22

Build and run the program main. You will have to create a build directory, move to the build directory, run cmake, and then build using make. See the workflow for Rainfall I for the commands.

Now run the program and notice that the output of the debugging statement is not shown. If it does show, run it a few times.

So even though the program reached the output statement, the output using std::cout was buffered and the program crash prevented it from completion.

Record running the program and not seeing the debugging output in a terminal session using asciinema.

Now, change the debugging statement to use std::cerr. Rebuild your program, and run it again. This time, you will see the debugging output. Commit this change using the git command:

Make sure you git push and verify, via a web browser, that these changes are in your files at GitHub.

Record running the program and seeing the debugging output in a terminal session using asciinema.

Upload both asciinema URLs using the IOBuffering Form

asciinema

To demonstrate this, you will record a terminal session using asciinema. It records the commands you enter and the output the command produces. asciinema is already installed in the GitHub Codespaces image. You can also install asciinema on Linux/WSL/macOS.

asciinema is relatively straightforward to use.

You can play, pause, skip, etc. You can also copy the commands as text. Note that the replay even includes your pauses and any delay as the command is run.

At the end of the terminal session, asciinema will show a URL. Anybody can use this URL to view the session. This is what you will submit for the exercise to the link in the exercise title.

IMPORTANT The URL should not contain "connect" or be a local file. Test your URL in a browser verifying that it shows the session you recorded. An incorrect URL will receive a 0.