{"id":20484210,"url":"https://github.com/khaledsalshibani/cpp-starter-kit","last_synced_at":"2026-03-19T16:03:56.523Z","repository":{"id":226606717,"uuid":"769102730","full_name":"khaledsAlshibani/cpp-starter-kit","owner":"khaledsAlshibani","description":"Here, you'll find a beginner-friendly overview of programming fundamentals using C++. Please note that this repository is still a work in progress and may not yet cover all topics comprehensively.","archived":false,"fork":false,"pushed_at":"2024-03-19T02:05:52.000Z","size":1570,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T16:18:43.461Z","etag":null,"topics":["cpp","programming-fundamentals","starter-kit"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khaledsAlshibani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T10:54:45.000Z","updated_at":"2025-01-23T10:55:13.000Z","dependencies_parsed_at":"2024-03-19T03:25:30.770Z","dependency_job_id":"6118c282-f467-476d-a641-dbea2a476669","html_url":"https://github.com/khaledsAlshibani/cpp-starter-kit","commit_stats":null,"previous_names":["khaledsalshibani/cpp-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khaledsAlshibani/cpp-starter-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaledsAlshibani%2Fcpp-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaledsAlshibani%2Fcpp-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaledsAlshibani%2Fcpp-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaledsAlshibani%2Fcpp-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khaledsAlshibani","download_url":"https://codeload.github.com/khaledsAlshibani/cpp-starter-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khaledsAlshibani%2Fcpp-starter-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30284776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","programming-fundamentals","starter-kit"],"created_at":"2024-11-15T16:20:28.111Z","updated_at":"2026-03-09T06:33:24.378Z","avatar_url":"https://github.com/khaledsAlshibani.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./assets/thumbnail.png\" alt=\"Thumbnail\" height=\"120\"\u003e\n    \u003cbr\u003e\n    \u003ch1\u003eC++ Starter Kit - Learn Fundamentals\u003c/h1\u003e\n    \u003cp\u003eHere, you'll find beginner-friendly programs tutorials, essential data structures, algorithms, and file operations. All with C++.\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n\u003e Universities prefer teaching programming fundamentals using C++ due to its efficiency, versatility, industry relevance, support for object-oriented programming principles, emphasis on memory management, and its role as a transitional language. C++ provides students with a solid foundation in low-level concepts, such as memory management and pointers, while also preparing them for a wide range of industries and programming domains. Its widespread use in industries like game development, systems programming, and scientific computing ensures that students acquire skills that are highly sought after in the job market. Additionally, C++ serves as a stepping stone for learning other languages, making it an ideal choice for introducing students to the core principles of programming.\n\u003e ([ChatGPT](https://chat.openai.com/share/b0cb4eda-0f9d-4b3b-aba1-d6887f08d3ac))\n\n- [Overview](#overview)\n  - [Why starting programming with c++](#why-starting-programming-with-c)\n  - [Using C++ with VS Code](#using-c-with-vs-code)\n- [Basic C++ Tutorials](#basic-c-tutorials)\n  - [Data Types](#data-types)\n    - [Example](#example)\n    - [Resources](#resources)\n  - [Basic Input and Output with `cin` and `cout`](#basic-input-and-output-with-cin-and-cout)\n    - [Example](#example-1)\n    - [Resources](#resources-1)\n  - [Control Structures](#control-structures)\n    - [Types of Control Structures](#types-of-control-structures)\n    - [Resources](#resources-2)\n  - [Functions](#functions)\n    - [Example](#example-2)\n    - [Resources](#resources-3)\n  - [Operators](#operators)\n    - [Types of Operators:](#types-of-operators)\n    - [Kinds of Operators based on Operands:](#kinds-of-operators-based-on-operands)\n- [Contributors ✨](#contributors-)\n\n## Overview\n\n### Why starting programming with c++\nC++ is a middle-level programming language, positioned between high-level languages like Python add javaScript and low-level languages like Assembly. It inherits features from both. C++ has the ability to perform low-level operations like memory management, similar to the C language. This makes it a suitable choice for understanding these operations, especially since it is not as difficult to learn as C or other low-level languages. Additionally, C++ provides high-level features such as object-oriented programming (OOP) as well as standard library support for data structures and algorithms.\n\n### Using C++ with VS Code\nTo use C++ with VS Code, you'll need a compiler. By default, VS Code doesn't support C++ compilers, so you must install one such as GCC. There are various methods to set this up, including using the Mingw-w64 executable or the `MSYS2` command-line interface (CLI). **See this resource**:\n- [VS Code docs - Setting up MinGW for C++ Development in Visual Studio Code](https://code.visualstudio.com/docs/cpp/config-mingw)\n\n## Basic C++ Tutorials\n\n### Data Types\n\nData types exist in all programming languages, although there may be small differences between them. For example, in C++, number data types include `int`, `float`, and `double`, while in TypeScript, there's only the `number` data type for numbers. Data types define the kind of data that a variable can hold, such as integers, floating point numbers, characters, and more. Here are the basic data types in C++:\n\n| Data Type | Description                                     | Size/Length  |\n| --------- | ----------------------------------------------- | ------------ |\n| `int`     | Used for integers                               | 2 or 4 bytes |\n| `float`   | Used for floating point numbers                 | 4 bytes      |\n| `double`  | Used for double sized floating point numbers    | 8 bytes      |\n| `char`    | Used for single characters                      | 1 byte       |\n| `bool`    | Used for boolean values (true/false)            | 1 byte       |\n| `auto`    | Automatically detects data type (C++11 version) | Variable     |\n\n#### Example\n\n```cpp\n// datatype variableName = value;\nint x = 5;\nchar c = 'A';\nbool isDone = true;\nauto y = x; // int\n```\n\n#### Resources\n- [W3Schools - C++ Data Types](https://www.w3schools.com/cpp/cpp_data_types.asp)\n\n### Basic Input and Output with `cin` and `cout`\nIn C++, the standard library `iostream` is commonly included in most `.cpp` files to control input and output operations.\n\nThe `cin` object, along with the `\u003e\u003e` extraction operator, is utilized for input operations. It allows users to input data from the console into variables. On the other hand, the `cout` object, paired with the `\u003c\u003c` insertion operator, is used for output operations and displaying data on the console.\n\nIt's important to note that when interacting with `cin`, input values should not contain spaces, as a space typically signifies the end of an input task. To input an entire line of text, the `getline` function can be used, which will be introduced later.\n\nAdditionally, the `cerr` and `clog` objects of the `iostream` library classes, they are used for error and logging purposes.\n\n#### Example\n\n```cpp\n// Declare an integer variable to store the user's input\nint number;\n\n// Display a prompt for the user to enter a number\ncout \u003c\u003c \"Enter a number: \";\n\n// Read the user's input from the console and store it in the 'number' variable\ncin \u003e\u003e number;\n\n// Display the entered number \ncout \u003c\u003c \"The number is: \" \u003c\u003c number \u003c\u003c endl;\n```\n\n#### Resources \n- [GeeksforGeeks - Basic Input / Output in C++](https://www.geeksforgeeks.org/basic-input-output-c/)\n- [Simplilearn - Understanding the Concept of Cin Object in C++ for Beginners](https://www.simplilearn.com/tutorials/cpp-tutorial/cpp-cin#:~:text=The%20C%2B%2B%20cin%20is%20an,extraction%20operator%20(%3E%3E).)\n- [GeeksforGeeks - Difference between cerr and clog](https://www.geeksforgeeks.org/difference-between-cerr-and-clog/)\n\n### Control Structures\n\nControl structures are fundamental to every programming language. They dictate the flow of a program, determining how it executes instructions based on sequence, selection, and iteration.\n\n#### Types of Control Structures\n\n1. **Sequence Logic**:\n   Sequence logic involves executing code in the order it's written, following a linear flow. Each line of code is executed in sequence, and any subsequent lines can override previous ones. For instance, setting a variable `x` to **0** and then setting it to **5** on the next line will result in `x` having a final value of **5**.\n\n   ```cpp\n   int x = 0;\n   x = 5; // The program will take this value\n   ```\n\n2. **Selection Logic (Conditional)**:\n   Selection logic means executing specific blocks of code based on some conditions. This is achieved using conditional statements such as `if`, `else if`, `else`, and `switch`.\n\n   ```cpp\n   bool isTrue = false;\n\n   if (isTrue) {\n       cout \u003c\u003c \"True\"; // Will not be displayed\n   } else {\n       cout \u003c\u003c \"False\"; // Will be displayed\n   }\n   ```\n\n3. **Iteration Logic**:\n   Iteration logic makes dynamic repetition through loops such as `while`, `for`, and `do while`. These loops repeatedly execute a block of code until a specific condition is met.\n\n   ```cpp\n   for (int i = 0; i \u003c 5; i++) {\n       cout \u003c\u003c i \u003c\u003c \" \";\n   }\n   ```\n\n   The code above will print numbers from 0 to 4 dynamically.\n\n#### Resources\n\n- [GeeksforGeeks - Control Structures in Programming Languages](https://www.geeksforgeeks.org/control-structures-in-programming-languages/)\n- [W3Schools - C++ If ... Else](https://www.w3schools.com/cpp/cpp_conditions.asp)\n- [Introduction to Iterators in C++](https://www.geeksforgeeks.org/introduction-iterators-c/)\n\n### Functions\n\nFunctions are essential components present in all high-level programming languages, whether functional or object-oriented. They are used as modular blocks of code designed to accomplish specific tasks without repeating the same code.\nIn C++, functions are integral to the program's structure, as the `main()` serves as the entry point for execution.\n\n\u003e Functions are \"self-contained\" modules of code that execute a specific task. They typically accept input data, process it, and return a result. Once defined, functions can be invoked repeatedly from within other functions.\n\u003e ([University of Utah Kahlert School of Computing](https://users.cs.utah.edu/~germain/PPS/Topics/functions.html#:~:text=Functions%20are%20%22self%20contained%22%20modules,the%20inside%20of%20other%20functions))\n\nThere are two main categories of functions:\n\n1. **Predefined Functions**:\n   Also known as built-in functions, these functions are provided by the language itself or from standard library headers in C++. Such as: `length()`, `size()`, and math functions.\n\n2. **User-defined Functions**:\n   These functions are created and implemented by the programmer to accomplish specific requirements.\n\nFunctions can be categorized based on their return type to:\n\n1. **Value-returning Functions**:\n   These functions return a value of a specified data type.\n\n2. **Void Functions**:\n   These functions do not return any value (`void`).\n\nIn C++, defining a function by specifying:\n1. The return type (Not required in all languages but in C++).\n2. The function name (following naming conventions).\n3. Parameters enclosed within parentheses.\n4. The function body enclosed within curly braces, containing the code to be processed and executed.\n\n#### Example\n\n```cpp\n// Void function\nvoid sayHello() {\n    cout \u003c\u003c \"Hello World\";\n}\n\n// Value returning function\nint calc() {\n    int a = 0;\n    int b = 2;\n\n    return a + b; // returns `2`\n}\n```\n\nParameters will be introduced later.\n\n#### Resources\n\n[W3Schools - C++ Functions](https://www.w3schools.com/cpp/cpp_functions.asp)\n[University of Utah Kahlert School of Computing](https://users.cs.utah.edu/~germain/PPS/Topics/functions.html#:~:text=Functions%20are%20%22self%20contained%22%20modules,the%20inside%20of%20other%20functions)\n\n### Operators\n\nOperators in C++ can be categorized into 5 different types. And also categorized two 3 kinds based on their functionality and the number of operands they involve.\n\n#### Types of Operators:\n1. **Arithmetic Operators**: For mathematical operations.\n2. **Assignment Operators**: For assigning values to variables.\n3. **Relational Operators**: For comparing values.\n4. **Logical Operators**: For logical operations (and / or).\n5. **Bitwise Operators**: Used for bit-level manipulation.\n\n#### Kinds of Operators based on Operands:\n- **Unary Operators**: Operate on a single operand.\n- **Binary Operators**: Operate on two operands.\n- **Ternary Operator**: Operates on three operands.\n\nFirst: Arithmetic operators\n\n| Operator | Kind     | Example                                    |\n|----------|----------|--------------------------------------------|\n| `+`      | Unary    | `+5` (output is positive value of 5)                 |\n|          | Binary   | `5 + 3` (output is 8)                |\n| `-`      | Unary    | `-5` (output is negative of 5)                       |\n|          | Binary   | `10 - 3` (output is 7)            |\n| `*`      | Binary   | `5 * 3` (output is 15)         |\n| `/`      | Binary   | `10 / 2` (output is 5)               |\n| `%`      | Binary   | `10 % 3` (output is 1)                |\n| `++`     | Unary    | `int x = 5; ++x;` (Called: pre-increment. output is x = 6) |\n| `--`     | Unary    | `int x = 5; x--;` (Called: post-increment. output is x = 4) |\n\nNote that the `+` and `-` operators can act as both unary and binary operators depending on the context in which they are used, +5 here it's unary while here 2 + 5 it's binary.\n\nSecond: Assignment Operators:\n\nIt's clear from the name that these operators assign values to variables. And they are binary operators. These operators are commonly used to update the value of variables based on calculations or conditions in the program.\n\n| Operator | Example                  |\n|----------|--------------------------|\n| `=`      | `int x = 5;`             |\n| `+=`     | `x += 3;` (equivalent to `x = x + 3;`) |\n| `-=`     | `x -= 2;` (equivalent to `x = x - 2;`) |\n| `*=`     | `x *= 4;` (equivalent to `x = x * 4;`) |\n| `/=`     | `x /= 2;` (equivalent to `x = x / 2;`) |\n| `%=`     | `x %= 3;` (equivalent to `x = x % 3;`) |\n\nArithmetic operators before the `=` sign will do a mathematical operation and then the `=` will assign the result to the variable.\nFor example `x += 2` it's the same as `x = x + 2` so the `2` will be added to the value of `x` rhen result of addition will be assigned to `x` as a new value.\n\nNotes:\n    - Both the variable and the value should be of the same data type.\n    - The variable should always be on the left side of the assignment operator, and the value to be assigned should be on the right side.\n\nThird: Relational Operators:\nRelational Operators are binary operators used for comparing purposes. They evaluate expressions and return either true or false based on the comparison result, and the are the core of programming languages. They are commonly used in conditional statements.\n\nThey are:\n\n| Operator | What is it           | Example           |\n|----------|----------------------|-------------------|\n| `==`     | Equal to             | `5 == 5` (true)   |\n| `!=`     | Not equal to         | `5 != 3` (true)   |\n| `\u003e`      | Greater than         | `10 \u003e 5` (true)   |\n| `\u003c`      | Less than            | `3 \u003c 8` (true)    |\n| `\u003e=`     | Greater than or equal| `5 \u003e= 5` (true)   |\n| `\u003c=`     | Less than or equal   | `8 \u003c= 8` (true)   |\n\nFourth: Logical Operators:\n\n*Pending ..*\n\n---\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://khaled.technway.biz/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/127689031?v=4?s=100\" width=\"100px;\" alt=\"Khaled Alshibani\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKhaled Alshibani\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/khaledsAlshibani/cpp-starter-kit/commits?author=khaledsAlshibani\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/khaledsAlshibani/cpp-starter-kit/commits?author=khaledsAlshibani\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#example-khaledsAlshibani\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"#ideas-khaledsAlshibani\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#tutorial-khaledsAlshibani\" title=\"Tutorials\"\u003e✅\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledsalshibani%2Fcpp-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhaledsalshibani%2Fcpp-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledsalshibani%2Fcpp-starter-kit/lists"}