Examining the memory with Qt Creator
For this section, we will use the following code snippet:
bool boolean = true; int integer = 5; char character = 'A'; int* integerPointer = &integer; qDebug() << "boolean is:" << boolean; qDebug() << "integer is:" << integer; qDebug() << "character is:" << character; qDebug() << "integerPointer is:" << integerPointer; qDebug() << "*integerPointer is:" << *integerPointer; qDebug() << "done!";
We declared three primitive types: boolean
, integer
, and character
. We also added a integerPointer
pointer that refers to the integer
variable. Put a breakpoint at the last line and start the debugging. On the Debug pane, you should have the Locals and Expressions view. You can easily add/remove it from Window | Views | Locals and Expressions. Here is a screenshot of it:
You...