Ultimate C++ Course - Lecture Notes

Jul 9, 2024

Ultimate C++ Course - Lecture Notes

Introduction to the Course

  • Instructor: Mosh Hamedani
    • Software Engineer with 20+ years of experience.
    • Instructor at codewithmosh.com.
  • Course Overview:
    • Comprehensive and practical, from basics to advanced concepts.
    • No prior knowledge required.
    • Designed to build confidence in writing C++ code.
    • Offers exercises and practical applications.
    • Aims to make students job-ready with C++ knowledge.

Importance and Applications of C++

  • Popular Language: Used by major companies (Adobe, Google, Microsoft, Netflix, NASA).
  • Performance Critical Applications: Video games, device drivers, web browsers, servers, operating systems.
  • Evolution: New versions every three years, latest is C++20.
  • Relevance: Despite newer languages, C++ remains fast and memory-efficient.
  • Career: Essential for computer science/software engineering students.
    • Influences other languages (C#, Java, JavaScript, TypeScript, Dart).
    • Average salary of a C++ programmer in the US is ~$170,000/year.

Mastering C++

  • Key Learning Areas:
    • C++ language syntax (grammar).
    • Standard Template Library (STL).
  • STL: Pre-written C++ code for data structures (lists, maps) and algorithms (searching, sorting).
  • Approach: Step-by-step exploration with exercises to reinforce concepts.
  • IDE for C++:
    • Microsoft Visual Studio (Windows).
    • Xcode (Mac).
    • CLion (Cross-platform, recommended for this course).
    • Other free alternatives available.

Setting Up IDE and First Program

  • Installation: Instructions for downloading and installing CLion.
  • Writing the First Program: Basic structure, syntax, and concepts.
    • Entry point: main() function.
    • Importance of format and convention.
    • Including standard library files, e.g., <iostream>.
    • Writing, compiling and running a simple