Final Exam Review for CS 201
Types
sizes are char <= short <= int <= long and float <= double
string is a class, not a built in type.
unsigned is a thing.
unsigned char is a thing.
Printing
cout formatting with http://faculty.cs.niu.edu/~mcmahon/CS241/c241man/node83.html
Pointers
Address of a variable is &foo.
Can you take the address of an expression like this: &(1+2).
What does it mean to take the address of a pointer: &pointer
In
parameter passing, these are different
foo(int *f)
foo(int &f)
* dereferences.
int *a; *a = 1; // this is bad
int *a = 1; // this is also bad.
What does -> mean, and how does that relate to * and .
What happens if you follow a bad pointer.
Legal: pointer + int, pointer – int, pointer-pointer. Know what type each produces.
Arrays and pointers
An array name is like a read only pointer
data[5] == *(data+5)
pointer++ and pointer-- only make sense on arrays and move by sizeof(type)
Files. Know how to do these things:
ifstream
ofstream
fstream
tellg
seekg
read
write
getline
How do you open a file.
Which operations cause the file pointer to move, and how?
How can you decide if a file exists?
How can you find the file size?
How can you find the number of lines in a file.
Assert command
Recursion
There is a base case and a one or more recursive cases.
Know how to do simple recursion examples with math
How to do simple recursion examples with linked lists
Standard Template Library
I expect you can look up stuff
When is a list, vector, or set the best choice?
Know how declare a vector of ints, or a set of strings, etc.
Bonus: Declare and use forward and reverse iterators
auto is useful here.
Header files
Know how to make a simple header file.
Know what code normally goes in the *.h file, and the *.c file.
Linked Lists
How to make, insert, delete, and search them.
Know storage costs
Know run time costs.
Circular Arrays
How to implement one
The conditions for empty and full
How to advance a pointer
Searching the array
Adding to the front and back