| Author |
Breaking code down
|
Douggie Fox
Greenhorn
Joined: Jun 14, 2001
Posts: 19
|
|
Hi, If you have a long, tricky piece of code that needs decifering in the exam, does anyone have any techniques for keeping track of variables? Paul
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4133
|
|
For tracing variables in loops, I use a table to keep track of iterations and values: <pre> int x=0; int y=0; for (int i = 0; i < 10; i++) { ... do something with x and y } i : x : y 0 : ? : ? 1 : ? : ? 2 : ? : ? 3 : ? : ? 4 : ? : ? </pre> Use a similar technique for tracing through various methods.
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
 |
|
|
subject: Breaking code down
|
|
|