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.

  1. Fundamentals
    1. How to compile a C program and save the results as something other than a.out
    2. How to log in to the CSIF
    3. Basic Linux commands: ls(1), ps(1), rm(1), gcc(1), apropos(1), man(1), vi(1)/vim(1)

  2. Structure of a C program
    1. main, return, exit
    2. Idea of an exit status code

  3. Basics of C
    1. Variable names
    2. Keywords
    3. Data types (int, float, double, char)
    4. Data type modifiers (signed, unsigned, long, short
    5. How true and false are represented

  4. Expressions
    1. Arithmetic operators; precedence, associativity
    2. Increment (++) and decrement (-{-})
    3. Logical operators
    4. Relational operators and Boolean values
    5. Type coercion (char to int, int to float, float to double)

  5. Input and output
    1. File pointers, especially stdin, stdout, stderr
    2. Opening and closing files
    3. getchar(), getc(), scanf(), fgets()
    4. putchar(), putc(), printf(), fputs()

  6. Statements
    1. Assignments, including += and other assignment operators
    2. for loop
    3. while, do … while loops
    4. if, if ... else, if ... elif ... else, nested ifs
    5. switch statement
    6. continue, break

  7. Functions
    1. Declaring and defining functions
    2. Returning a value; return statement
    3. Parameters and arguments
    4. Scope (local vs. global, etc.)
    5. Static variables in function

  8. Functions
    1. Defining them
    2. Parameter lists and how they work
    3. Returning a value; return statement
    4. Parameters and arguments
    5. Scope (local vs. global, etc.)
    6. Static variables in function

  9. Pointers
    1. What it is
    2. Declaring and using pointer variables
    3. Dereferencing (*) and taking the address of (&)
    4. Use in parameter lists
    5. Array of pointers

  10. Arrays
    1. Declaring an array
    2. Referencing an element of the array
    3. Relationship between arrays and pointers
    4. Arrays as function parameters and arguments

  11. Strings
    1. What is a string
    2. Array of strings
    3. String functions: strcpy, strcat, strcmp, n versions, strlen, strtok
    4. String to number conversion, number to string conversion: the sscanf, sprintf, snprintf

  12. Robust programming
    1. Checking input for validity
    2. Buffer overflows


You can also obtain a PDF version of this. Version of October 21, 2015 at 5:19PM