Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Harvard-IACS/c_cpp_primer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

SEAS C/C++ Primer

This primer class is voluntary and not graded. It will consist of lecture components that teach you the essentials along with embedded hands-on exercises that will take place interactively during class. You are required to bring your laptop and should have some intuition and comfort in using the command line (know how to navigate, create files and directories as well as being able to edit files with an editor or IDE of your choice). You will not be given homework for this class.

The class consists of 10 lectures at 75 minutes duration. These lectures will be held in the evening to avoid possible conflicts with your schedule. A previous class taken for either language or experience gathered through other means may be helpful.

Schedule and Location

Location: SEC LL2.224 SU Family Classroom

Time: 5:30PM - 6:45PM

Date: 09/19 - 09/30 (calendar week 38 and 39)

Meeting times: Lectures are held on each week day Monday to Friday.

Registration

You can register for the class by joining our mailing list. You can enroll the class by sending an email to

code-primer+subscribe@g.harvard.edu
(subscribe by sending a blank email to this address; use the email address associated with your HarvardID)

You will be asked to confirm your enrollment.

If you have questions about the class, you can send an email to the class mailing list

code-primer@g.harvard.edu

Messages will be sent to all subscribed students such that they can benefit from your question as well.

Lecture Content

Lectures 1-4 discuss basic concepts that were first introduced in C. Lectures 5-10 focus on C++ specific language features that are not available in C.

Lecture 1

  • Procedural languages and Object Oriented Programming / General overview
  • Compiled languages / Stages of code compilation / Get to know your compiler
  • Building code / make / meson / cmake

Lecture 2

  • Basic built-in types
  • Arrays
  • Pointers
  • Pointers are not arrays

Lecture 3

  • Pointers and dereference operator
  • References (C++ specific)
  • Basic operators and operator precedence
  • Functions and function pointers
  • Anonymous functions / Lambdas (C++ specific)

Lecture 4

  • Function arguments: Pass-by-value / Pass-by-reference
  • Memory allocation
  • Stack and heap
  • Input/Output (IO) / Streams

Lecture 5

  • Object Oriented versus Data Oriented designs / Where is C++ good at and where can it hurt you
  • Classes: Constructors / Initializer lists / Destructors / Members / Attributes
  • Access modifiers

Lecture 6

  • Resource Acquisition Is Initialization (RAII)
  • Operator overloading
  • Inheritance and the this pointer

Lecture 7

  • Base class pointers
  • Polymorphism and interfaces
  • virtual methods

Lecture 8

  • Abstract base classes
  • Pure virtual methods
  • Operator overriding
  • C++11 extension modules for python

Lecture 9

  • Generic programming
  • C++ templates
  • Implementation approaches

Lecture 10

  • Standard Template Library (STL)