diff --git a/pretext/AtomicData/Pointers.ptx b/pretext/AtomicData/Pointers.ptx index 75cb472..123cb1e 100644 --- a/pretext/AtomicData/Pointers.ptx +++ b/pretext/AtomicData/Pointers.ptx @@ -244,7 +244,7 @@ int main( ) { - Reading Question + Reading Questions @@ -301,6 +301,53 @@ int main( ) { + + + +

+ Construct a C++ program that stores an integer in varN, makes a pointer + ptrN point to it, and then uses the pointer to print the value. + Drag the blocks into the correct order on the right. +

+
+ + + #include <iostream> + using namespace std; + + + + int main() { + + + + int varN = 9; + + + + + int *ptrN = &varN; + + + int *ptrN = varN; + + + + + + cout << *ptrN << endl; + + + cout << ptrN << endl; + + + + + return 0; + } + + +