Quiz 4: Study Guide
Wednesday, April 18, 2012An Incomplete List of Potential Topics:
- New for this quiz
- Arrays
- How to define an array
- Invalid defintions of arrays
- Accessing array elements
- Using loops to access arrays
- How to prevent accessing invalid array elements
- How memory for arrays are stored
- Strings
- Relationship of strings and arrays
- How does C mark the end of a string?
- How does the computer store the NULL character?
- Input and output for strings
- How to tell scanf the maximum characters to input
- What happens if you don't limit the number of characters to input?
- Program Design
- Top-down design, what is it?
- How does top-down design help us create programs?
- Arrays
- Topics from previous quizzes
- 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
- Common programming errors covered last class