Learning resources: C & C++

How to Use these Resources

The resources below offer tutorials and references for learning modern C and/or C++ programming and using in different computing contexts.  Some are generic resources written from the perspective of industry practitioners, but most target computational scientists and engineers with varying degrees of programming experience in other languages. Additional references specific to using C and C++ in HPC applications can be found on our MPI and OpenMP resource pages.

 

Videos

C Programming Tutorial for Beginners -- a ~4 hr video course from freeCodeCamp.org.

Modern C++ for Computational Scientists -- a four-part video series on the C++11 standard.  Geared at computational scientists.  Part of the Virtual Tutorials series from ARCHER (the UK National Supercomputing Service)

C++ for C Programmers -- an archive of videos, along with slides and materials for exercises, from a few different versions of a C++ course (aimed at C programmers) taught at the Texas Advanced Computing Center (TACC)

Kokkos Online Class (2020) -- a multiweek online course that teaches the basics of Kokkos, a framework for machine portable and hardware-independent C++ code for high-performance applications.  From the Exascale Computing Project (ECP).

 

Self-paced online courses

An Introduction to C Programming -- self-paced online course from the Cornell University Center for Advanced Computing (CAC) geared at computational scientists and engineers

C++ Institute -- offers a variety of free, online self-paced courses in C++.

Introduction to C and C++ -- a 2013 introduction to C & C++ from MIT Open Courseware (OCW)

Effective Programming in C and C++ -- a 2014 more intermediate level course from OCW

C++ Courses from EdX -- free online C++ courses.  Emphasis and flavor tends to be more about industry applications than computational science, but still an effective resource for learning the language.

 

Web pages / written online tutorials

Introduction to the C Language -- slides (Part 1 and Part 2) from a 2014 workshop on C aimed at computational scientists.  From the National Institute for Computational Scientists (NICS) at the University of Tennessee, Knoxville.

The C++ Reference -- a website that maintains a language reference and tutorials for different versions of C++ (up to C++20).  The C++ language section in particular is a good resource for learning the basic syntax and features of the language.

C++ Core Guidelines -- a "living document" maintained on Github (updated regularly), from the creator of C++.  Offers a current summary of recommendations for good structure and style for writing C++.  An excellent supplement to older pedagogic resources in order to incorporate "modern" C++ practices.

Modern C++ for C Programmers -- effective written resource for those transitioning from C to C++.  Includes links to code samples for exercises (on Github).

C and C++ Tutorials -- written self-paced tutorials on C and C++, from Cprogramming.com.  Very comprehensive introduction to basic language features.  Both also available as print books (links to print editions in the tutorials).

C++ Tutorial -- comprehensive online tutorial.  Consistent with C++11.

iscinumpy Blog Posts on C++  evolution -- the author maintains a series of posts (linked) on evolving features of "modern" C++, starting with C++11.

 

Books

C++ Crash Course: A Fast-paced Introduction (2020) -- website for a relatively new book aimed at intermediate to advanced programmers new to C++.  Written for C++17.  Includes information for where to find a print copy.  Also includes errata and a downloadable version of all the source code and examples in the code.

Thinking in C++ (2000)-- online PDF version of a comprehensive book on C++ programming.  Especially good for its treatment of object-oriented programming. Unfortunately written only with older versions of C++ in mind, so it should be supplemented by another resource that shows more modern features of C++.

Teach Yourself C++ in One Hour a Day -- good C++ resource for beginners (and a useful reference thereafter).  Link is to print version.  Online version from O'Reilly books is available from Princeton University Library for free to those with an active NetID.

C++ for C Programmers -- written resource for C programmers transitioning to C++.  Link is to print version.

Introduction to High-Performance Scientific Computing -- book by Victor Eijkhout from the Texas Advanced Computing Center (TACC).  Available in online and print versions.  Chapters 20 & 27 give a comprehensive theoretical summary of compilers and C/Fortran language interoperability, respectively.