You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Language/C++/C++.md
+44-44Lines changed: 44 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,74 +70,74 @@ Each release has aimed to enhance the language's expressiveness, safety, and per
70
70
71
71
Using C++ involves several steps, from setting up your development environment to writing, compiling, and running your code. Here's a step-by-step guide to get you started:
72
72
73
-
1.### Install a C++ Compiler
73
+
1.**Install a C++ Compiler**
74
74
75
-
You'll need a C++ compiler to translate your source code into machine code. Popular compilers include:
75
+
You'll need a C++ compiler to translate your source code into machine code. Popular compilers include:
76
76
77
-
- GCC (GNU Compiler Collection): Common on Unix-like systems.
78
-
- Visual C++ Compiler: Included with Visual Studio on Windows.
79
-
- Clang: Another open-source compiler available on multiple platforms.
80
-
81
-
The compiler you choose will need to be based on your operating system and preferences.
77
+
- GCC (GNU Compiler Collection): Common on Unix-like systems.
78
+
- Visual C++ Compiler: Included with Visual Studio on Windows.
79
+
- Clang: Another open-source compiler available on multiple platforms.
80
+
81
+
The compiler you choose will need to be based on your operating system and preferences.
82
82
83
-
2.### Choose an Integrated Development Environment (IDE)
83
+
2.**Choose an Integrated Development Environment (IDE)**
84
84
85
-
You'll then need to select an IDE or a text editor to write your C++ code. Some popular options include:
85
+
You'll then need to select an IDE or a text editor to write your C++ code. Some popular options include:
86
86
87
-
- Visual Studio: A powerful IDE available on Windows with excellent C++ support.
88
-
- Code::Blocks: An open-source, cross-platform IDE.
89
-
- Eclipse: A versatile IDE that supports C++ development.
90
-
- Visual Studio Code: A lightweight and extensible code editor with C++ support.
87
+
- Visual Studio: A powerful IDE available on Windows with excellent C++ support.
88
+
- Code::Blocks: An open-source, cross-platform IDE.
89
+
- Eclipse: A versatile IDE that supports C++ development.
90
+
- Visual Studio Code: A lightweight and extensible code editor with C++ support.
91
91
92
-
3.### Write C++ Code
92
+
3.**Write C++ Code**
93
93
94
-
Simply create a new C++ source file (typically with a .cpp extension) using your chosen IDE or text editor, and write your C++ code using the C++ syntax and features!
94
+
Simply create a new C++ source file (typically with a .cpp extension) using your chosen IDE or text editor, and write your C++ code using the C++ syntax and features!
95
95
96
-
Here's a simple "Hello, World!" program:
96
+
Here's a simple "Hello, World!" program:
97
97
98
-
{: .code }
99
-
```cpp
100
-
#include<iostream>
98
+
{: .code }
99
+
```cpp
100
+
#include<iostream>
101
101
102
-
intmain()
103
-
{
104
-
std::cout << "Hello, World!" << std::endl;
105
-
return 42069;
106
-
}
107
-
```
102
+
intmain()
103
+
{
104
+
std::cout << "Hello, World!" << std::endl;
105
+
return 42069;
106
+
}
107
+
```
108
108
109
-
4.### Save
109
+
4.**Save**
110
110
111
-
Save your C++ code with a meaningful filename and the .cpp extension.
111
+
Save your C++ code with a meaningful filename and the .cpp extension.
112
112
113
-
5.### Compile
113
+
5.**Compile**
114
114
115
-
Use the command-line interface or the IDE to compile your C++ code, using GCC:
115
+
Use the command-line interface or the IDE to compile your C++ code, using GCC:
116
116
117
-
{: .code }
118
-
```bash
119
-
g++ your_program.cpp -o your_program
120
-
```
117
+
{: .code }
118
+
```bash
119
+
g++ your_program.cpp -o your_program
120
+
```
121
121
122
-
This command will compile your code (your_program.cpp) and generate an executable named `your_program`.
122
+
This command will compile your code (your_program.cpp) and generate an executable named `your_program`.
123
123
124
-
6.### Run The Program:
124
+
6. **Run The Program:**
125
125
126
-
Execute the compiled program!
126
+
Execute the compiled program!
127
127
128
-
- On the command line:
129
-
-`./your_program` (Unix-like systems)
130
-
-`your_program.exe` (Windows)
128
+
- On the command line:
129
+
- `./your_program` (Unix-like systems)
130
+
- `your_program.exe` (Windows)
131
131
132
-
In the IDE, there's also usually a "Run" or "Debug" button. In Visual Studio, you can press `F5` to build.
132
+
In the IDE, there's also usually a "Run" or "Debug" button. In Visual Studio, you can press `F5` to build.
133
133
134
-
7.### Debugging
134
+
7. **Debugging**
135
135
136
-
Use the debugging features provided by your IDE or compiler to identify and fix errors in your code. Common debugging techniques include setting breakpoints, inspecting variables, and stepping through code. The methods in which you do this will vary between tools.
136
+
Use the debugging features provided by your IDE or compiler to identify and fix errors in your code. Common debugging techniques include setting breakpoints, inspecting variables, and stepping through code. The methods in which you do this will vary between tools.
137
137
138
-
8.### Learn and Experiment:
138
+
8. **Learn and Experiment:**
139
139
140
-
Explore C++ features, syntax, and libraries. Experiment with different code examples and gradually tackle more complex projects. Online resources, tutorials, and C++ documentation can be valuable references.
140
+
Explore C++ features, syntax, and libraries. Experiment with different code examples and gradually tackle more complex projects. Online resources, tutorials, and C++ documentation can be valuable references.
0 commit comments