DEV Community

Suman Samanta
Suman Samanta

Posted on

Day 1 of #100DaysOfCode

Today I Learned (C++ Basics Recap)

  • Set up a personal C++ boilerplate in VS Code for faster coding
  • Explored data types, variable naming, and preprocessor directives
  • Learned about namespace std and why it's used
  • Covered:
    • Constants, implicit/explicit typecasting
    • Arithmetic, unary, relational, logical operators
    • if, else, switch, ternary ops
    • Loops (while, for, do-while), break & continue
  • Practiced: sum of n numbers, prime check

Takeaway

A clean setup and strong basics make everything smoother.

Codes: https://github.com/GeekyProgrammer07/DSA

"C++ Boilerplate": {
        "prefix": "cppboiler",
        "body": [
            "#include <iostream>",
            "using namespace std;",
            "",
            "int main() {",
            "    $1",
            "    return 0;",
            "}"
        ],
        "description": "Basic C++ boilerplate with fast IO"
    },
    "Input 1 variable": {
        "prefix": "enterInput",
        "body": [
            "int n;",
            "cout << \"Enter the number: \";",
            "cin >> n;",
            "$1"
        ],
        "description": "Basic C++ boilerplate to take input of 1 number"
    }
Enter fullscreen mode Exit fullscreen mode

Image description
Image description

Top comments (0)