Mid-term 1, Thursday 4th March
Subject Categories
- Defining and Using Objects
- struct definitions (or class definitions if you prefer)
- struct-type variables
- accessing the members/contents
- passing as parameters or return result from function
- in arrays (as pointers and not as pointers)
- Input, Output, and String Processing
- Files
- Build-your-own input functions using getchar
- i/o and strings
- string processing
- Of course, be sure you are good at function definition and use now.
- Memory concerns
- new: using it, what it does, why it is needed
- globals vs heap vs stack: memory areas
- problems to avoid, uninitialised pointers, array overruns, segmentation faults.
The test will last one hour.
You will need to show that you understand the material we have covered, by being
able to produce (parts of) programs that do specific things, analyse and understand
parts of programs given to you, explain how certain things work and what their
point is, and assess the relative merits of alternative ways of doing things.
There will be no questions that require large amounts of English prose. In fact
extra points will be awarded for answers that are short and to the point (provided
that they are correct and cover everything required). Points will be lost for
long rambling answers that don't make sense.