Midterm Study Guide
This is simply a guide of topics that I consider important for the midterm. I don’t promise to ask you about them all, or about any of these in particular; but I may very well ask you about any of these, as well as anything we discussed in class, in the discussion section, or that is in the programs and handouts.
- Fundamentals
- How to compile a C program and save the results as something other than a.out
- How to log in to the CSIF
- Basic Linux commands: ls(1), ps(1), rm(1), gcc(1), apropos(1), man(1), vi(1)/vim(1)
- Linux file system
- Structure of a C program
- main, return, exit
- Idea of an exit status code
- Basics of C
- Variable names
- Keywords
- Data types (int, float, double, char)
- Data type modifiers (signed, unsigned, long, short)
- How true and false are represented
- Expressions
- Arithmetic operators; precedence, associativity
- Increment (++) and decrement (--)
- Logical operators
- Relational operators and Boolean values
- Type coercion (char to int, int to float, float to double)
- Statements
- Assignments, including += and other assignment operators
- for loop
- while, do … while loops
- if, if ... else, if ... elif ... else, nested ifs
- switch statement
- continue, break
- Functions
- Declaring and defining functions
- Parameter lists and how they work
- Returning a value; return statement
- Scope (local vs. global, etc.)
- Pointers
- What they are
- Declaring and using pointer variables
- Dereferencing (*) and taking the address of (&)
- Use in parameter lists
- Arrays
- Declaring an array
- Referencing an element of the array
- Relationship between arrays and pointers
- Arrays as function parameters and arguments
- Strings
- What is a string
- Array of strings
- String functions: strcpy, strcat, strcmp, n versions of these, strlen
- Recursion