An exercise in reading code
- Look at demo.C, we should know this code.
- Look at readCode1.C
- Look at readCode2.C
- in each code,
- Before you run it, what does the code do?
- What output would you expect?
- What calculations happen?
- Is there anything strange in the code? What does that do?
- Does the formatting make it easier/harder to read the code?
- Compile and run the code.
- Did it do as you expected?
- If not, what happened and why?
- If you needed to, could you extend this code?
- Could you make basic changes to the code?