COP-4338, Programming III Lectures
Note: Links will not be alive until a day or two before class.
- May 7: Starting with C
- C basics: main, printf, some low-level stuff.
- Pointer Variables: The address-of opeator & and an
introduction to pointers.
- May 9 and 14: More C
- Pointer variables: dereferencing * operator
- Simulating call-by-reference
- scanf
- Runaway pointers.
- Arrays
- Strings
- Pointer hopping
- Dynamic allocation of arrays
- May14.c Code from May 14
- May 16, 21, and 23: structs, I/O, files
- May 28: No class
- May 30: Discussion of Assignment #1, Macros, Functions as Parameters
- June 4: Discussion of Assignment #2, C Review
- June 6: Exam #1
- June 11, 13, 18, 20, 25: Classes
- Simple C++
- Classes: interfaces, member functions, visibility
- Accessor/Mutator
- Const and non-const methods
- Constructors
- Initializer lists
- Implicit type conversions
- Explicit constructors
- Default parameters
- The big three: destructor, operator= and copy constructor
- *this
- Aliasing and this
- Separation of interface and implementation
- Scope :: operator
- ifndef/endif and separate compilation
- Static members
- Operator overloading
- Friends
- Constant and reference data member
- Linked data structures
- Example: The Rational class
- Reference return types and operator[]
- Example: The String class (Sample code from class)
- June 27 and July 2: Inheritance
- Implementing a derived class
- Constructors
- Defaults for the Big Three in the derived class
- Protected members
- Slicing
- Static vs. dynamic binding
- virtual keyword
- The virtual destructor
- Various C++ differences from Java
- July 4: No Class
- July 9 and 16: Templates
- Why templates
- Function templates
- Class templates: interface
- Illustration of the MemoryCell class
- Specifying the requirements of the template type
- Class templates: implementation
- Separate compilation issues
- Function Objects
- Exceptions
- Reference return types
- matrix
- July 11: Exam #2 Covers C++ Classes, and inheritance, but not templates
- July 16 and 18: STL
- July 23, 25, July 30: Threads and Synchronization
- PDF slides
- Examples:
- Illustrates basics of getting threads to run:
ThreadDemo.java
- Illustrates threads corrupting data:
NoSync.java
- Series of examples using an Account.
Some threads do deposits, some do withdraws on shared account.
- Two examples with multiple monitors
- Static methods have different monitors than instance methods:
StaticsAndThreads.java
- July 30 and Aug 1: Networking
- Aug 6: Threading and Networking Review and Review for Exam
- Aug 8: Exam #3: Covers C++ and Threading and Networking