-
Notifications
You must be signed in to change notification settings - Fork 1
/
c++_Notes.txt
57 lines (31 loc) · 1.06 KB
/
c++_Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Compiling the code:
g++ command is a GNU c++ compiler invocation command, which is used for preprocessing, compilation, assembly and linking of source code to generate an executable file. The different “options” of g++ command allow us to stop this process at the intermediate stage.
g++ hello_World.cpp
To output the binary code in the terminal ./helloWorld
Default compiled binary file name is a.out
Commenting:
//this is a comment
Multi line comments...
/* This is all commented.
std::cout << "hi!";
None of this is going to run! */
Re-naming compiled files:
g++ hello_World.cpp -o hello.cpp
Data Types:
int = 9
Char = e
string = “this is string”
Bool = True or False
Floats = 1.9
Boolean bool
Character char
Integer int
Floating point float
Double floating point double
Valueless void
Wide character wchar_t
Int score = 9
Std::cin >> score >> “What do you want the new score to be? “
std ::cout << score
Debugging:
creating a debugging file using -ggdb flag, similar to creating the a.out but this will do both. (VS Code)