From 3939a4c4334f56bc43e8b78f229610368aa954ea Mon Sep 17 00:00:00 2001 From: "Coo.King" <39448470+Pega-Stellar@users.noreply.github.com> Date: Tue, 16 Oct 2018 10:18:59 +0700 Subject: [PATCH] Update index.md (#19051) --- .../src/pages/guide/english/cplusplus/compilers/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/pages/guide/english/cplusplus/compilers/index.md b/client/src/pages/guide/english/cplusplus/compilers/index.md index d1c11bbce1..9d9b0f94a9 100644 --- a/client/src/pages/guide/english/cplusplus/compilers/index.md +++ b/client/src/pages/guide/english/cplusplus/compilers/index.md @@ -78,6 +78,15 @@ to compile and execute your code directly, run `g++ -o helloWorld helloWorld.cpp; ./helloWorld` so when you need to compile and run your code multiple times, 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