🟢 Foundation · Lesson 03
C++ Setup: GCC, MinGW, VS Code and Online Compiler
C++ Setup: GCC, MinGW, VS Code and Online Compiler
What is C++ Setup: GCC, MinGW, VS Code and Online Compiler?
C++ Setup: GCC, MinGW, VS Code and Online Compiler
To run C++ programs, you need a compiler such as GCC/MinGW, an editor such as VS Code, or an online compiler for quick practice. Setup teaches how source code becomes an executable program.
To run C++ programs, you need a compiler such as GCC/MinGW, an editor such as VS Code, or an online compiler for quick practice. Setup teaches how source code becomes an executable program.
Level
🟢 Beginner – C++ Foundation
🟢 Beginner – C++ Foundation
Example File
setup-compiler.cppMain Focus
Concept + syntax + practical C++ program
Concept + syntax + practical C++ program
Why should you learn this?
- It helps you write correct and readable C++ programs.
- It is used repeatedly in school practicals, projects and competitive programming.
- It builds the base for advanced topics such as OOP, STL and data structures.
Important Terms
| Term | Meaning / Use |
|---|---|
| GCC | C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में Gcc use होता है। |
| MinGW | C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में Mingw use होता है। |
| g++ | G++ used in C++ Setup: GCC, MinGW, VS Code and Online Compiler programming. |
| VS Code | C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में Vs code use होता है। |
| terminal | C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में Terminal use होता है। |
Syntax / Pattern
C++
Compile a file using: g++ program.cpp -o program and run it using ./program or program.exe on Windows.
Example Program
main.cpp
// File: hello.cpp
#include <iostream>
using namespace std;
int main() {
cout << "Compiler is ready";
return 0;
}
// Terminal command:
// g++ hello.cpp -o hello
// ./helloExpected Output
Compiler is ready
Program Explanation
- The compiler checks syntax and converts code into machine executable form.
- The -o option sets the output executable name.
Exam Tip: In C++ practical answers, write the logic first, then the program, then expected output. For theory, always include one suitable example.
Where will you use it?
- school lab setup
- local practice
- debugging compile errors
Common Mistakes
- Saving file with .txt extension.
- Installing VS Code but not installing compiler.
- Forgetting to add compiler path.
Practice Tasks
- Install any C++ compiler and run Hello World.
- Write the command to compile test.cpp.
Summary
C++ Setup: GCC, MinGW, VS Code and Online Compiler एक ज़रूरी C++ topic है। परिभाषा सीखें, syntax समझें, example program चलाएं और फिर practice tasks हल करके concept मज़बूत करें।
C++ Setup: GCC, MinGW, VS Code and Online Compiler क्या है?
C++ Setup: GCC, MinGW, VS Code and Online Compiler
To run C++ programs, you need a compiler such as GCC/MinGW, an editor such as VS Code, or an online compiler for quick practice. Setup teaches how source code becomes an executable program.
To run C++ programs, you need a compiler such as GCC/MinGW, an editor such as VS Code, or an online compiler for quick practice. Setup teaches how source code becomes an executable program.
Level
🟢 Beginner – C++ Foundation
🟢 Beginner – C++ Foundation
Example File
setup-compiler.cppमुख्य फोकस
Concept + syntax + practical C++ program
Concept + syntax + practical C++ program
इसे क्यों सीखें?
- यह आपको सही और पढ़ने-योग्य C++ programs लिखने में मदद करता है।
- यह school practicals, projects और competitive programming में बार-बार use होता है।
- यह OOP, STL और data structures जैसे advanced topics की नींव बनाता है।
ज़रूरी Terms
| Term | अर्थ / उपयोग |
|---|---|
| GCC | Gcc C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में use होता है। |
| MinGW | Mingw C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में use होता है। |
| g++ | G++ C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में use होता है। |
| VS Code | Vs code C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में use होता है। |
| terminal | Terminal C++ Setup: GCC, MinGW, VS Code and Online Compiler programming में use होता है। |
Syntax / Pattern
C++
Compile a file using: g++ program.cpp -o program and run it using ./program or program.exe on Windows.
Example Program
main.cpp
// File: hello.cpp
#include <iostream>
using namespace std;
int main() {
cout << "Compiler is ready";
return 0;
}
// Terminal command:
// g++ hello.cpp -o hello
// ./helloExpected Output
Compiler is ready
Program Explanation
- The compiler checks syntax and converts code into machine executable form.
- The -o option sets the output executable name.
Exam Tip: In C++ practical answers, write the logic first, then the program, then expected output. For theory, always include one suitable example.
Where will you use it?
- school lab setup
- local practice
- debugging compile errors
आम गलतियाँ (Common Mistakes)
- Saving file with .txt extension.
- Installing VS Code but not installing compiler.
- Forgetting to add compiler path.
अभ्यास (Practice Tasks)
- Install any C++ compiler and run Hello World.
- Write the command to compile test.cpp.
सारांश
C++ Setup: GCC, MinGW, VS Code and Online Compiler एक ज़रूरी C++ topic है। परिभाषा सीखें, syntax समझें, example program चलाएं और फिर practice tasks हल करके concept मज़बूत करें।
💻 Live Code Editor
Is page ke program yahan ready hain — chalाएं, badlें aur seekhें. Bina kuch install kiye.
Powered by OneCompiler. Editor mein code apne aap aa jata hai — Run dabaakर output dekhें.
Agar load na ho to naye tab mein kholें.