Skip to content

This Repo contains the codes from scratch to learn C, C++ (STL) & Object Oriented Programming

Notifications You must be signed in to change notification settings

princebansal7/C-CPP-Logic-Building

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn C, C++, OOP & DSA

1. Why this Repository ?

  • To strengthen the basics of C, C++ & Object oriented paradigms concepts.
  • Follow sequential manner to get the gist of "How to build logics"
  • C Language | Link
  • C++ Language with Object Oriented Concepts | Link

2. Additional Links

  • DSA using Object Oriented Paradigms (OOP) & concepts | Link
  • TCS NQT Sheet (Great for basic logic building) | Link
  • 180 SDE Sheet | Link
  • 450 Sheet | Link
  • A2Z Sheet | Link
  • CodeHelp YT | Link
  • DSA Complete Repo | Link

3. VsCode Code-Runner extension settings to automatically removes binary files like: .exe or .out

  • for Windows

    "code-runner.executorMap": {
      "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt -lm && $fileNameWithoutExt.exe && del $fileNameWithoutExt.exe",
      "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt -lm && $fileNameWithoutExt.exe && del $fileNameWithoutExt.exe"
    },
  • for Mac/Linux

    "code-runner.executorMap": {
      "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt -lm && $dir$fileNameWithoutExt && rm $dir$fileNameWithoutExt",
      "cpp":"cd $dir && g++ $fileName -o $fileNameWithoutExt -lm && ./$fileNameWithoutExt && rm ./$fileNameWithoutExt",
    },

    Note: You can customize these settings as per your own need, my personalized configuration is:

    "code-runner.executorMap": {
      "java": "cd $dir && javac $fileName && java $fileNameWithoutExt && rm $fileNameWithoutExt.class",
      "c": "cd $dir && gcc-13 $fileName -o $fileNameWithoutExt -lm && $dir$fileNameWithoutExt && rm $dir$fileNameWithoutExt",
      "cpp":"cd $dir && g++-13 -std=c++17 $fileName -o $fileNameWithoutExt -lm && ./$fileNameWithoutExt && rm ./$fileNameWithoutExt",
      "python": "python3 -u",
    },

4. Fixes & Things worth knowing:

  • <math.h> in VsCode fixed: if math.h isn't working in your VsCode, use -lm flag in execution command to link 'math' library.

       gcc test.c -lm
           or
       gcc test.c -o test -lm
  • Alternatively use <cmath> header file in C++ programs then you won't need -lm flag.

  • Use <cstring> header file instead of <string.h> to use C style pre-defined string functions like: strupr(), strcpy(), strcat() etc in C++ programs.

  • cout is object of ostream class, and << is Insertion operator.

  • cin is object of istream class, and >> is Extraction operator.

About

This Repo contains the codes from scratch to learn C, C++ (STL) & Object Oriented Programming

Topics

Resources

Stars

Watchers

Forks