A beginner-friendly C++ programming repository designed for students, self-learners, and anyone revisiting C++ fundamentals.
π©βπ» Created by Sakiba Belal
π Department of Software Engineering, NSTU
This repository contains practical C++ code examples and exercises to help learners understand and apply core C++ concepts. It's ideal for:
- π§ Absolute beginners to C++
- π©βπ University students (e.g., NSTU) learning C++
- π§ Self-learners revisiting C++ after a gap
- πΌ Interview preparation for C++ roles
The repository includes examples on:
- β Basic syntax and structure
- β Variables and data types
- β Control structures (if-else, loops)
- β Functions and recursion
- β Arrays and strings
- β
Object-Oriented Programming (OOP)
- Classes and objects
- Inheritance
- Polymorphism
- Encapsulation
- β File I/O operations
- β Memory management (pointers, references)
- β Standard Template Library (STL)
learnCpp/
βββ src/
β βββ Abstraction.cpp
β βββ LargeNumber.cpp
β βββ SpecialCharacter.cpp
β βββ and.cpp
β βββ array.cpp
β βββ assign.cpp
β βββ ...
βββ include/
β βββ ...
βββ .vscode/
β βββ ...
βββ README.md
You can compile and run the C++ files using any C++ compiler. Here's how to do it using g++:
-
Open a terminal or command prompt.
-
Navigate to the directory containing the
.cppfile. -
Compile the code:
g++ filename.cpp -o outputname
4. Run the compiled program:
```bash
./outputname
```
Alternatively, you can open the files in an Integrated Development Environment (IDE) like **Visual Studio Code**, **Code::Blocks**, or **CLion** and run them directly from there.
---
## π§ Sample Code
Here's a simple example demonstrating the use of arrays in C++:
```cpp
// array.cpp
#include <iostream>
int main() {
int arr[] = {1, 2, 3, 4, 5};
for(int i = 0; i < 5; i++) {
std::cout << "Element " << i << ": " << arr[i] << std::endl;
}
return 0;
}
```
---
## π― Learning Objectives
By exploring this repository, you will:
* Understand the fundamental concepts of C++
* Gain hands-on experience with coding exercises
* Prepare for academic exams and interviews
* Build a solid foundation for advanced C++ topics
---
## π¬ Feedback
If you have any questions, suggestions, or feedback, feel free to open an issue or contact me directly.
Happy coding! π
```