Final Exam Review for CS 201


  1. Types

    1. sizes are char <= short <= int <= long and float <= double

    2. string is a class, not a built in type.

    3. unsigned is a thing.

    4. unsigned char is a thing.

  2. Pointers

    1. Address of a variable is &foo.

    2. Can you take the address of an expression like this: &(1+2).

    3. What does it mean to take the address of a pointer: &pointer

    4. In parameter passing, these are different
      foo(int *f)
      foo(int &f)

    5. * dereferences.

    6. int *a; *a = 1; // this is bad

    7. int *a = 1; // this is also bad.

    8. What does -> mean, and how does that relate to * and .

    9. What happens if you follow a bad pointer.

    10. Legal: pointer + int, pointer – int, pointer-pointer. Know what type this produces.

  3. Arrays and pointers

    1. An array name is like a read only pointer

    2. data[5] == *(data+5)

    3. pointer++ and pointer-- only make sense on arrays and move by sizeof(type)

  4. Files. Know how to do these things:

    1. ifstream

    2. ofstream

    3. fstream

    4. tellg

    5. seekg

    6. read

    7. write

    8. getline

    9. How do you open a file.

    10. Which operations cause the file pointer to move, and how?

    11. How can you decide if a file exists?

    12. How can you find the file size?

    13. How can you find the number of lines in a file.

    14. If I give you a simple file format like WAV or BMP, know how to look up where some piece of data (like resolution or sample rate) is.

  5. Assert command

  6. Recursion

    1. There is a base case and a one or more recursive cases.

    2. Know how to do simple recursion examples

  7. Standard Template Library

    1. I expect you can look up stuff

    2. When is a list, vector, or set the best choice?

    3. Know hot declare a vector of ints, or a set of strings, etc.

    4. Declare and use forward and reverse iterators

      1. auto is useful here.

  8. Templates

    1. Know how to make a simple template example.

    2. Know that the code normally goes in the *.h file.

  9. Linked Lists

    1. How to make, insert, delete, and search them.

    2. Know storage costs

    3. Know run time costs.