These are my personal study notes on C and C++, collected while learning programming fundamentals and working through small examples. They explain the language rules, memory model, standard library, and tools I want to remember when writing and reviewing programs.
The examples use C17 and C++20 as practical baselines. Compiler and library support can vary, so check the selected compiler version when using newer language or library features. The notes focus on portable language behavior and call out cases where implementation details matter.
The chapters move from compilation and C fundamentals into pointers, files, modern C++, resource ownership, templates, containers, concurrency, testing, and debugging. The final chapters gather the code examples and review questions.
- Toolchain, compilation, and the first program
- C types, objects, and lifetime
- Expressions and control flow in C
- C functions, headers, and linkage
- C arrays and strings
- C pointers and dynamic memory
- C structures, unions, and enumerations
- C files, streams, and errors
- C preprocessing and macros
- C++ types, references, const, and initialization
- C++ classes, constructors, and RAII
- C++ value categories and move semantics
- C++ templates and generic programming
- C++ containers, iterators, and algorithms
- C++ errors, exceptions, and value results
- Concurrency, threads, and atomics
- Build systems, debugging, and testing
- All code samples
- Complete questions and answers
I keep these notes as a learning record and a reference for concepts I want to explain clearly. Read the chapters in order for a foundation, or jump directly to a topic when reviewing code. The examples are small enough to compile and inspect, with practice questions that encourage checking behavior rather than guessing.
Compiler diagnostics are part of the learning process. Build examples with warnings enabled, read the language and library references, and use sanitizers and a debugger when a program behaves unexpectedly.
- C language working drafts and standards information
- C++ working draft
- C++ Core Guidelines
- GCC documentation
- Clang documentation
- CMake documentation
- Portfolio: https://www.ashishranjan.net
- GitHub: https://github.com/a2rp
- CodePen: https://codepen.io/ash1198
- LinkedIn: https://www.linkedin.com/in/aashishranjan
- Facebook: https://www.facebook.com/theash.ashish/
- YouTube: https://www.youtube.com/@ashishranjan-ashz?sub_confirmation=1
- Email: mailto:ash.ranjan09@gmail.com
- Support: https://a2rp-donation-page.netlify.app/
- Buy Me a Coffee: https://buymeacoffee.com/ashishranjan
- Patreon: https://www.patreon.com/ashishranjan