Skip to content
supunxiiiPublic

About

a comprehensive code based short note covering the basics of C++.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Overview

learn-cpp is a code-short note to understand the basics of C++, designed as a simple, code-first learning aid. To learn, users can uncomment the code lines and execute the file to see how each concept works in practice. It briefly covers core theory such as data types, variables, constants, namespaces, type conversions, input handling, operators, control flow, loops, functions, arrays, pointers, recursion, structs, classes, constructors, inheritance, and templates.

C++

Features

The learn-cpp notes include the following:

  1. Core Types and Variables

    • Integers, doubles, chars, booleans, and strings
    • Constants and basic assignments
  2. Operators and Conversions

    • Arithmetic and logical operators
    • Implicit and explicit type conversions
  3. Input and Strings

    • User input with std::cin and std::getline
    • String utilities and indexing
  4. Control Flow

    • If/else and switch statements
    • Ternary operator usage
  5. Iteration

    • While, do-while, and for loops
    • Nested loops and loop control
  6. Functions and Reuse

    • Function definitions and overloading
    • Return values and recursion
  7. Arrays and Memory

    • Arrays and multi-dimensional arrays
    • Pointers, references, and memory addresses
  8. Structures and OOP

    • Structs and enums
    • Classes, constructors, getters/setters, and inheritance
  9. Templates

    • Function templates for generic behaviour

Technologies Used

  • C++23: Core language used for all examples
  • No External Libraries: All code uses only standard C++ headers

Project Structure

learn-cpp/
├── .vscode/
│   ├── settings.json
│   └── tasks.json
├── helloworld.cpp
└── helloworld.exe

Getting Started

To run the notes locally, follow these steps:

  1. Open the repository folder.

  2. Uncomment the code lines you want to try in helloworld.cpp.

  3. Compile the file in your terminal:

    g++ -std=c++23 helloworld.cpp -o helloworld
  4. Run the program:

    ./helloworld

Developer

This project was developed by:

  • Supun Wijesooriya - Developer

Contributing

Contributions are welcome. If you would like to contribute, please follow these steps:

  1. Fork the repository.

  2. Create a new branch:

    git checkout -b feature/your-feature-name
  3. Make your changes and commit them:

    git commit -m "Add your commit message"
  4. Push your changes to your forked repository:

    git push origin feature/your-feature-name
  5. Open a pull request to the main repository.

Important Notes

  • These notes are intended for learning and revision of C++ fundamentals.
  • Uncomment only the sections you want to run to avoid conflicting inputs.
  • Examples are intentionally minimal to keep the focus on core concepts.

Contact

For any enquiries or feedback, please contact the developer:

About

a comprehensive code based short note covering the basics of C++.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages