Update index.md (#19051)
This commit is contained in:
@ -78,6 +78,15 @@ to compile and execute your code directly, run
|
|||||||
`g++ -o helloWorld helloWorld.cpp; ./helloWorld`
|
`g++ -o helloWorld helloWorld.cpp; ./helloWorld`
|
||||||
so when you need to compile and run your code multiple times,
|
so when you need to compile and run your code multiple times,
|
||||||
up arrow-enter
|
up arrow-enter
|
||||||
|
|
||||||
|
### Adding Flags
|
||||||
|
You can also add flags to the compiler to your custom and favor. For example:
|
||||||
|
`g++ -O2 helloWorld.cpp -o helloWorld`
|
||||||
|
Some common flags is :
|
||||||
|
1. -O2 : Optimize your code, so it may run faster
|
||||||
|
2. -std=c++11 : use c++11 instead of c++98 which is defaulted.
|
||||||
|
3. -Wall: prompt some warning about some common mistakes which can bug your program.
|
||||||
|
4. -Wextra: prompt some extra warning.
|
||||||
____________
|
____________
|
||||||
|
|
||||||
There are a number of different types of compilers. The two listed are the two that are usually packaged with the Windows
|
There are a number of different types of compilers. The two listed are the two that are usually packaged with the Windows
|
||||||
|
Reference in New Issue
Block a user