How do you write, compile and run your first C++ program?
Write a hello world program in C++, compile it from the terminal, run it and fix the most common beginner errors.
341 posts about C++: questions with answers, tutorials and articles, newest first.
Write a hello world program in C++, compile it from the terminal, run it and fix the most common beginner errors.
Step-by-step setup of a C++ compiler for Windows, Linux and macOS, with a quick test program to confirm the toolchain works.
A study-order C++ roadmap with 18 parts, from installing a compiler to move semantics, the STL, threads, CMake and C++23 features.
C++ has no triple equals. See how == compares values, when types convert, and how to enforce strict type equality with templates and C++20 defaulted operators.
Compare C and C++ syntax and features with examples: structs vs classes, overloading, templates, memory handling and what breaks when C compiles as C++.
C is a small procedural language, while C++ adds classes, templates, RAII and a large standard library. See the differences with code and a comparison table.
A Markov Decision Process defines the problem, while Monte Carlo estimates answers from random samples. Compare both in a runnable C++20 example.
Monte Carlo algorithms estimate values by averaging random samples. See a reusable C++ integration template with standard error and parallel use.
A Markov decision process models decisions under uncertainty. This guide implements one in C++20 with a value iteration class and explains each part.
Dynamic programming needs a known model, while reinforcement learning learns from interaction. See both in modern C++ with value iteration and Q-learning.
Dynamic programming caches overlapping subproblems to avoid repeated work. See memoization and tabulation in modern C++ with coin change, knapsack and edit distance.
A reinforcement learning algorithm learns by rewards. This guide explains Q-learning and gives a complete C++20 agent you can compile and run.
Active learning lets a model pick the examples a human should label next. This guide explains uncertainty sampling and shows a complete C++20 implementation.
Semi-supervised learning combines a few labels with many unlabeled examples. This guide implements confidence-based self-training in modern C++ and compares alternatives.
Supervised learning predicts from labeled data, unsupervised learning finds structure in unlabeled data. Includes tested C++20 k-NN and k-means code.
Unsupervised learning finds patterns in unlabelled data. This guide implements k-means clustering in C++20 with a runnable class, expected output and tuning advice.
A supervised learning algorithm learns from labelled data. See how to implement logistic regression and k-NN in modern C++ with tested code.
Classic RL stores values in a table; deep RL approximates them with a neural network. See both approaches in C++ with working code and when to pick each.
Implement reinforcement learning in modern C++ with a Q-learning agent class, std::array, the random header and a complete, runnable corridor example.
Implement Q-learning in C++20 and see how a deep Q-network with replay and a target network is trained using LibTorch, with tested and annotated code.