Quiz 3: Study Guide
Wednesday, April 04, 2012An Incomplete List of Potential Topics:
- Common programming errors covered last class
- Wrong function signatures
- Return when function has signature "void function(...)"
- Use of scanf overwriting input arguments
- Shadowing input arguments with variables
- Using printf when asked to return value
- Loops
- do...while
- while
- for
- What can go in test expressions?
- Use of break or return to break out of loops
- Nested loops
- Libraries
- Math library include (math.h) adding library to compilation (-lm)
- C Standard library includes (stdlib.h, stdio.h)
- Linker combines compiled source code and libraries into executable
- GCC is front end, acts as both the compiler and linker
- Functions
- Create functions
- Arguments
- Return types
- Calling functions
- Use of void (as return type or arguments)
- Conditional expressions
- if
- if...else
- if...else if...
- Relational operators (<, >, <=, >=, ==, !=)
- Logical operators (||, &&)
- Values for true (non-zero) and false (zero)
- Switch
- When can it be used vs if-else-if...
- Limitations of use
- Case statement fall-through
- Default
- Input/Output
- Character input (how to avoid problem with extra-return)
- Printf and scanf syntax for integer, double, and char