C++ is a cross-platform programming language that is widely used to create high-performance applications. Developed by Bjarne Stroustrup as an extension of the C language, C++ offers programmers a high level of control over system resources and memory. It is an object-oriented language, which means it emphasizes using data fields with unique attributes (objects) rather than logic or functions.
C++ is known for its versatility and efficiency, making it suitable for a wide range of applications. Some of the common use cases include:
- Operating Systems: Many operating systems, such as Microsoft Windows and Mac OS X, are developed using C++.
- Game Development: C++ is popular in game development due to its performance and ability to handle complex 3D games and multiplayer games.
- Web Browsers: Browsers like Mozilla Firefox and parts of Google Chrome are developed in C++.
- Embedded Systems: C++ is used in embedded systems that require programs to be close to the hardware, such as smartwatches and medical equipment.
| File | Description |
|---|---|
01_variables_and_basic_data_types |
Variables and fundamental data types in C++. |
02_const |
Usage of const for constants and immutability. |
03_namespaces |
Organizing code with namespaces. |
04_typedef_and_type_aliases |
Creating type aliases with typedef and using. |
05_arithmetic_operators |
Basic arithmetic operators. |
06_type_conversion |
Implicit and explicit type conversions. |
07_user_input |
Taking input from users with cin. |
08_useful_math_related_functions |
Common math-related functions. |
09_hypotenuse_calculator |
Program to calculate the hypotenuse. |
10_if_statements |
Conditional logic with if. |
11_switches |
Switch-case statements. |
12_console_calculator |
Simple calculator in console. |
13_ternary_operator |
Using the ternary operator for conditions. |
14_logical_operators |
Logical operators (&&, ` |
15_temperature_conversion_program |
Program for temperature conversions. |
16_useful_string_methods |
Useful methods for manipulating strings. |
17_while_loops |
Iteration with while loops. |
18_do_while_loops |
Iteration with do-while loops. |
19_for_loops |
Iteration with for loops. |
20_break_&_continue |
Using break and continue in loops. |
21_nested_loops |
Loops within loops. |
22_random_number_generator |
Generating random numbers. |
23_random_event_generator |
Random event simulation. |
24_number_guessing_game |
Game for guessing numbers. |
25_user_defined_functions |
Writing user-defined functions. |
26_return_keyword |
Returning values from functions. |
27_overloaded_functions |
Function overloading. |
28_variable_scope |
Scope and lifetime of variables. |
29_banking_practice_program |
Banking system practice program. |
30_rock_paper_scissors_game |
Rock-Paper-Scissors game. |
31_arrays |
Introduction to arrays. |
32_sizeof_operator |
Using sizeof operator. |
33_iterate_over_an_array |
Iterating over arrays. |
34_foreach_loop |
Foreach-style loop in C++. |
35_pass_array_to_a_function |
Passing arrays to functions. |
36_search_an_array_for_an_element |
Searching elements in arrays. |
37_sort_an_array |
Sorting arrays. |
38_fill_function |
Filling arrays with values. |
39_fill_an_array_with_user_input |
Filling arrays with user input. |
40_multidimensional_arrays |
Working with multidimensional arrays. |
41_quiz_game |
Quiz game program. |
42_memory_addresses |
Working with memory addresses. |
43_pass_by_value_vs_pass_by_reference |
Difference between pass by value and reference. |
44_const_parameters |
Using const parameters in functions. |
45_credit_card_validator_program |
Program to validate credit cards. |
46_pointers |
Introduction to pointers. |
47_null_pointers |
Null pointers in C++. |
48_tic_tac_toe_game |
Tic-Tac-Toe game implementation. |
49_dynamic_memory |
Dynamic memory allocation. |
50_recursion |
Recursive functions. |
51_function_templates |
Using function templates. |
52_structs |
Defining and using structs. |
53_pass_structs_as_arguments |
Passing structs as arguments. |
54_enums |
Enumerations in C++. |
55_object_oriented_programming |
Object-Oriented Programming basics. |
56_constructors |
Constructors in C++. |
57_constructor_overloading |
Constructor overloading. |
58_getters_and_setters |
Encapsulation with getters and setters. |
59_inheritance |
Inheritance in OOP. |
To run these projects, you can simply use the Python code from each folder and run it on any IDE you prefer.
-
Clone the repository to your local machine:
git clone https://github.com/your-username/your-repository-name.git
-
Navigate to any C++ folders, for example:
cd your-repository-name/01_variables_and_basic_data_types/helloworld.cpp -
Open the terminal in VS Code by pressing Ctrl+ (backtick) and run the following command to compile your code:
g++ -o helloworld helloworld.cpp
-
After compiling, run the executable by typing the following command in the terminal:
./helloworld
Feel free to fork this repository and submit your own C++ projects or improvements via pull requests!
This project is licensed under the MIT License - see the LICENSE file for details.
