w04-bsc-pointer-basics
Pointer basics
Go into tehpc/basics/
. Consider the following two codes:
bsc_pointers_1.cpp
bsc_pointers_2.cpp
Compile them and run them with
- going into the
tehpc/build/
folder (possibly in another terminal) - compile with the following command:
g++ -Werror -Wpedantic -g -o bsc_pointers_X ../basics/bsc_pointers_X.cpp
whereX
is1
or2
. - run code with
./bsc_pointers_X
(when you runbsc_pointers_2
, open another terminal and typetop
-- observe)
Analyze what these codes do and why they do this.