Fall 2025
-
COMS 4995-007: Mon & Wed 5:40-6:55pm, 750 CEPSR (Costa Engineering Commons)
-
Two synchronous and in-person exams:
- Exam 1: Wednesday October 22, 5:40p - 7:10p
- Exam 2: Wednesday December 17, 4:10p - 7:00p
There are no make-up or alternate exams.
If you cannot make any of those exams, please take the course next time.
-
Instructor: Hans J. Montero
-
Hans & TA office hours: calendar
-
Anonymous feedback form
Course essentials
Important Dates
| Date |
Assignment |
| F 9/19 |
Lab 1 due |
| Su 10/5 |
Lab 2 due |
| F 10/17 |
Lab 3 due |
| W 10/22 |
Exam 1 |
| F 11/14 |
Lab 4 due |
| M 12/8 |
Lab 5 due |
| W 12/17 |
Exam 2 |
Course Schedule
Course overview and logistics
- OVERVIEW AND LOGISTICS
-
Assignments:
-
Subscribe to c2cpp@lists.cs.columbia.edu – see L00 above
- Read the following two documents:
-
HW0 due Fri 9/5, 11:59pm
Send an email to Hans and Jae containing:
- To: hans@cs.columbia.edu, jae@cs.columbia.edu
- Subject: “[c2cpp] hw0-UNI” – without quotes, sole space before
hw0, UNI replaced with your actual UNI in lowercase
- Your name, major & school program, year – e.g., Hans Montero,
Computer Science, Columbia Engineering, class of 2021
- Your pledge – see http://www.cs.columbia.edu/~jae/honesty.html
- CS classes taken and/or other programming background
- Optionally anything else you want to let us know
- Optionally attach a picture of you, but please reduce image file
size to about 100KB
C to C++ (c2cpp)
- Lecture: 01-c2cpp
- Compiling & linking C++ code with Makefile
- Introduction to string, iostream, namespace
- Source code:
Basic-4 in C++
- Lecture: 02-basic4
- Member functions
- Constructors and destructors
- Stack allocations and heap allocations
- Source code: Makefile, basic4.cpp
Basic-4 in C++ (continued)
- Lecture: 02-basic4
- heap allocation of arrays
- passing by value vs. passing by reference
- const member function
- three cases of copy construction
- copy elision
- Source code: Makefile, basic4.cpp
Basic-4 in C++ (continued)
MyString class
MyString class (continued)
MyString class (continued)
Function template
Dynamically growable array
Move semantics
Move semantics (continued)
Vec class template
Vec class template (continued)
Inheritance and Polymorphism
Inheritance and Polymorphism (continued)
- Lecture: 08-inheritance
- Inheritance basics (review)
- Memory layout of derived classes (review)
- Static binding vs. dynamic binding
- Virtual function table (
vtable)
- Multiple inheritance object layout
static_cast
- Source code: Makefile,
inherit1.cpp,
inherit2.cpp
Inheritance and Polymorphism (continued)
- Lecture: 08-inheritance
- Multiple inheritance without virtual functions (review)
static_cast (review)
- Multiple inheritance with virtual functions
- The diamond problem
- Virtual inheritance
- Order of construction & destruction
- Pure virtual functions & abstract class
- Virtual destructor
- Source code: Makefile,
inherit2.cpp
inherit3.cpp
inherit4.cpp
inherit5.cpp
I/O streams
I/O streams (continued)
- Lecture: 09-io-streams
- I/O Stream Library class hierarchy (review)
- I/O manipulator (review)
- I/O state
- Recovering from I/O failure
- Mixing C and C++ I/O
- I/O of user-defined structure
- String streams
- File streams
-
Source code: Makefile,
io1.cpp,
io2.cpp,
io3.cpp,
- Sample input files: good,
malformed
STL Sequence Containers
Iterators
- Lecture: 11-iterators
For_Each() template function
begin() & end()
const_iterator
- iterator and range-for loop
- Subtleties in
For_Each() implementation
(b != e) vs. (b < e)
++b vs. b++
- Source code: Makefile,
iterator1.cpp
Exam 1
- Coverage:
- Labs 1, 2, and 3
- Lecture notes 1-9 (up to and including I/O streams)
- Type alias (
using syntax) from lecture note 10
- Sample exams
- All ANN emails
Iterators (continued)
Associative containers
| No class on M 11/3 – Fall Break |
Functional programming in C++
Functional programming in C++ (continued)
Random number generator
Random number generator (continued)
- Lecture: 15-rng
- Random number generator in C vs. C++ (review)
- Mersenne Twister engine (review)
- Normal distribution
- Danger of narrowing conversions
- Stateful functors
- Very stateful functors
- Source code: Makefile,
rand1.cpp,
rand2.cpp
Value categories and forwarding reference
Value categories and forwarding reference (continued)
Variadic templates
| No class on W 11/26 – Thanksgiving Break |
Smart Pointers
| Guest Lecture: Tuesday 12/2 |
Swift and C++ Interoperability, by John Hui
Time: 10:10am - 11:25am
Location: CSB 453 (Traub Conference Room)
Abstract:
C++ interoperability is an actively evolving feature of the Swift programming
language, and allows large C++ projects to gradually incorporate memory-safe
Swift code without compromising C++’s expressiveness at the language boundary.
In this talk, I will explain how Swift interoperates with C++ and why this
matters for modern software development. I’ll introduce Swift through the lens
of C++ interoperation, starting from what the two languages have in common, and
build toward the practical and design challenges of bridging them.
Bio:
John Hui is a compiler engineer on the C Languages & Libraries team at Apple,
where he works on C++ interoperability in Swift. Prior to Apple, John completed
his undergraduate (CC’18) and graduate (MS’19, PhD’24) studies at Columbia
University. For his doctoral research, he worked with Prof. Stephen Edwards on a
software programming model for real-time embedded systems.
Smart Pointers (continued)
(Bonus) Introduction to concurrency
- Topics covered:
- Introduction to threads
- C pthread API
- False sharing & cache conscious programming
- Mutex
- Source code: Makefile,
pthread.cpp
(Bonus) Introduction to concurrency (continued)
- Topics covered:
- C++ threads:
std::thread and std::mutex
- RAII for threads:
std::jthread and std::scoped_lock
- Condition variable
- Source code: Makefile,
concur.cpp,
cond-var.cpp
Course wrap-up
Exam 2
- Logistics:
- W 12/17, 4:10p - 7p
- CEPSR 750 (our usual classroom)
- Length: 2hr (but you can use the full 2hr 50min period)
- Coverage:
- Labs 1-5
- Lecture notes 1-17
- Skip over I/O state and multiple/virtual inheritance object layout and
vtable details
- Lecture note 18 (concurrency) is out of scope
- Our Exam 1
- All sample exams
- All ANN emails
Last updated: 2025-12-8