CS35: Data Structures and Algorithms

Monday | Wednesday | Friday
Week 02 Lecture Notes

Announcements

  • 6 people not signed into Piazza - Activation email sent Thursday night
  • Register your clicker
    • still missing a few students
  • Update github profile with name/email
  • lab01 due Sunday night
  • partnered labs start next Monday
    • partners strongly encouraged
    • you can select, or we can pair
  • Questions

This week

Imperative programming

OOP - Object Oriented programming

C++ Object Syntax

Class declaration

class ClassName {
    private:
      // data or methods you want to protect from external access
    public:
      // data or methods the class-user can access
};  // this semicolon is required
Wednesday

Exercise: worksheet

Header files

Sample test

A Diversion into pointers

type ptr type
int int*
float float*
string string*
Point Point*
  int a=5;
  int* p;

  p=&a; //p is the address of a

  //prints out the value of the variable stored at the address stored by p.
  cout << *p << endl;

  *p = 6; //changes the value of a
Friday

Missing Clicker accounts

There are 36 registered clickers and 38 students in the class. Please purchase and register your clicker.

The following clicker IDs are not registered to a student name. Please connect your clicker to this course.

207, 35C, 61A, A10, F66

Exercise: worksheet

Dynamic memory

Coming up. Using pointers for Polymorphism