The last tracing is for dynamic memory. No matter how experienced in programming a person maybe they will always, always, ALWAYS trace dynamic memory. It is the most complex as both values and spots for them are kept track.
Depending on what language or level of Computer Science used this can wait till latter. Also read up on the language's specifics for dynamic memory, i.e. references and pointers to be sure.
int x = 2; int *p = new int(4); *p = &x; *p = 3; p = null; | ![]() |
|
int *p, *q = new int(0); p = q; *q = 3; *p = 2; delete p; q = new int(4); delete q; p = q = NULL; | ![]() |
|
int x = 4; int &r = x; int *p; p = &x; r = 2; *p = 5; p = new int(2); int &s = *p; p = NULL; s = 1; | ![]() |
|
Prev -- Back to Portal -- Next