Welcome to this repository! 👋 This is a personal documentation of my journey learning C++, where I’ve created multiple small files and programs to practice and understand the language.
If you’re starting with C++ or want to learn through practical examples, feel free to explore these files. You can clone this repository and try running them on your local machine.
To compile and run C++ files, you’ll need a compiler. We’ll use MinGW-w64, which provides g++.
Follow this official VS Code guide: 👉 Using GCC (MinGW) with VS Code
Quick steps:
-
Download MinGW-w64 from https://www.mingw-w64.org/downloads/
-
Install it (select architecture
x86_64and threadsposixduring setup). -
Add the
binfolder path (e.g.,C:\Program Files\mingw-w64\...\bin) to your Environment Variables →Path. -
Verify by running in terminal:
g++ --version
- Install VS Code from https://code.visualstudio.com
- Install the C/C++ extension by Microsoft (
ms-vscode.cpptools). - Open your folder in VS Code and start coding.
-
Create a file
hello.cpp:#include <iostream> using namespace std; int main() { cout << "Hello, C++!" << endl; return 0; }
-
Compile it:
g++ hello.cpp -o hello
-
Run it:
./hello
(Use
hello.exeon Windows PowerShell / CMD.)
-
Clone this repository
git clone https://github.com/Yagna123k/Learn-CPP.git cd Learn-CPP -
Open in VS Code
code . -
Pick any
.cppfile, compile & run it. Modify the code to experiment.
If you want to add more examples, feel free to open a pull request!
If you find this helpful, give it a ⭐ and share it with others who want to learn C++.
Happy coding! 🚀