I was out of town this weekend and didn't get as much done as I'd like, so the webpage for today is more sparse than usual. The code is still all there though.

A brief discussion of pointers

A quick explanation of why we care about pointers: As we get better at coding, we start to care about memory management more and more. In PIC10A much of the important memory management is done for us. Best example: vectors. There's a lot of data being stored somewhere. It's being resized and moved around. We don't see any of the details though.

Pointers store the location of your objects in computer memory. So as we start to care about memory management we will use them much more. If you continue taking c++ classes (PIC or something else) expect to see a lot of pointers.

    Basic syntax of pointers: pointers_part1.cpp
    Arithmetic and [] with pointers: pointers_part2.cpp
    Passing pointers into functions: pointers_part3.cpp
    Arrays are similar to pointers: pointers_part4.cpp
  

Review for final:

I have no more new material to show you. So let's start on final review. Here are some problems that we'll work on together in class.

    Build a class: Temperature.cpp
    Write a loop that does basic math: ThreeNPlusOne.cpp
    Write a loop that looks through vector entries: isPalindrome.cpp
    Get random numbers in certain ranges:randPerm.cpp
  

If we have extra time:

Sometimes we cover material faster than I expect. If that happens we'll do this.

    Sorting a vector via the bubblesort algorithm: bubbleSort.cpp