This demo will provide experience using the debugging tool gdb. Download the source file gdb_demo2.c and the Makefile
First, build the code using make gdb_demo2
.
Run the code. Is the result what you expect? (HINT: No ...). Use gdb
to investigate the problem and fix it
Add a line of code to print the balance (when you exit the while loop) ... is the balance what you expect?
We will (hopefully) have time to do this in class!