C++ Cheatsheet
C++ Cheatsheet
C++ Cheatsheet
This C++ programing cheat sheet can be very handy to use and provides key information in a short
time frame. It is tailormade for people who want to address important topics and leap into the world
of programming in C++. This includes all major and minor details one might need to surf through, and
contains examples and code snippets to guide people on how to practically use this language.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
cout<<"Hello World"<<endl;
Output
Hello World
Comments
Comments in C++ are used to write extra information that are useful to the programmer. C supports
single-line comment // is used to indicate the single-line comment, whereas /* is used to start a multi-
line comment and */ to end it.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
/* This is multi-lined comment.
The below statement will only print Hello World*/
cout<<"Hello World"<<endl;
return 0;
}
Output
Hello World
Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified
expert to boost your career.
Example
#include <bits/stdc++.h>
using namespace std;
int main() {
Variables
Variables are areas of storage where different types of data can be invariably stored. The variables in
c++ must be declared before using, and the names of variables must start with an alphabet, and can
contain letters, numbers and underscore(_).
Example
#include <bits/stdc++.h>
using namespace std;
int main() {
Keywords
Keywords are special type of words that are reserved by the compiler of a specific language and can’t
be explicitly used by the programmer. Some of these keywords are as follows −
Page 4 of 45
Data Types
Data types are types of available classifications of storage where variables are stored in the memory.
Data types can be categorized into three sections −
1.1. Int
The keyword used for integer data types is int. Integers typically require 4 bytes of memory space and
range from -2147483648 to 2147483647.
Page 5 of 45
1.2. Float
Floating Point data type is used for storing single-precision floating-point values or decimal values.
The keyword used for the floating-point data type is float. Float variables typically require 4 bytes of
memory space.
1.3. Char
Character data type is used for storing characters. The keyword used for the character data type is
char. Characters typically require 1 byte of memory space and range from -128 to 127 or 0 to 255.
1.4. Double
Double Floating Point data type is used for storing double-precision floating-point values or decimal
values. The keyword used for the double floating-point data type is double.
1.5. String
String data type is used for storing multiple characters together in a single variable.
1.6. Bool
Boolean data type is used for storing Boolean or logical values. A Boolean variable can store either
true or false. The keyword used for the Boolean data type is bool.
Example
int main() {
int age=12;
//takes only whole numbers, size is 4 Bytes
float weight=70.4;
//takes decimal valued numbers, size is 4 Bytes
char alpha='a';
//takes single characters as per ASCII, size is 1 Bytes
double d=2.2222;
//takes more precise floating point numbers, size is 8 Bytes
Page 6 of 45
bool k=true;
//takes only true or false values (or 0/1)
return 0;
}
Function
Array
Pointer
Reference
3.1. Class
The concept of classes and objects is explained in OOPS section of this cheatsheet. Examples can be
referred here.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
class MyClass {
public:
int myNum;
string myString;
};
Page 7 of 45
int main() {
MyClass myObj;
myObj.myNum = 1234567;
myObj.myString = "Helloooo";
Output
1234567
Helloooo
3.2. Structure
The syntax of defining a structure is as follows.
struct structName{
char varName[size];
int varName;
};
3.3. Union
The syntax of defining a union is as follows.
Union_Name{
// Declaration of data members
}; union_variables;
3.4. Enumeration
The syntax of defining an enum variable is as follows.
Page 8 of 45
enum nameOfEnum {
varName1 = 1, varName2 = 0
};
3.5. Typedef
The syntax of defining a typedef is as follows.
typedef typeName;
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
BYTE b1, b2;
b1 = 'c';
cout << " " << b1;
return 0;
}
Output
Conditional Statements
Conditional statements control the flow of the program, and can be used when we need to define
different cases and conditions. The primitives "if", "else", "else if", "switch" and the ternary operator are
used in such cases.
if Statement
Page 9 of 45
if-else Statement
if-else-if Statement
Switch Statement
Ternary Operator
1. If statement
If statement executes a block of code if and only if the given condition is true.
2. if-else Statement
If the condition inside the if statement is true, then the code inside the if block will get executed,
otherwise code inside the else block will get executed.
3. if-else-if Statement
The else if statement allows you to check for multiple conditions sequentially.
4. Nested if Statements
Multiple if statements can be nested inside each other to form different cases as per requirement.
5. Ternary Operator
It works as a conditional statement which takes a conditional statement and returns either the first
statement or the second statement.
6. Switch Case
In case of multiple conditions, we can simply use switch case statements to make it easier to handle
such conditions.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
Page 10 of 45
else cout<<"MAYBE"<<endl;
case 1 :
cout<<"true"<<endl;
break;
default:
cout<<"invalid"<<endl;
break;
}
return 0;
}
Output
MAYBE
true
true
Operators
Page 11 of 45
1. Arithmetic Operators
These operators are used to perform arithmetic or mathematical operations on the operands. For
example, ‘+’ is used for addition, ‘-‘ is used for subtraction ‘*’ is used for multiplication, etc.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
int a = 8, b = 3;
// Addition operator
cout << "a + b = " << (a + b) << endl;
// Subtraction operator
cout << "a - b = " << (a - b) << endl;
// Multiplication operator
cout << "a * b = " << (a * b) << endl;
// Division operator
cout << "a / b = " << (a / b) << endl;
// Modulo operator
cout << "a % b = " << (a % b) << endl;
//unary operators
a++;
cout<<a<<endl;
a--;
cout<<a<<endl;
k=++a - --b;
Page 12 of 45
cout<<k<<endl;
return 0;
}
Output
a + b = 11
a-b=5
a * b = 24
a/b=2
a%b=2
9
8
13
7
2. Relational Operators
These operators are used for the comparison of the values of two operands. For example, ‘>’ checks if
one operand is greater than the other operand or not, etc. The result returns a Boolean value, i.e., true
or false.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
int a = 6, b = 4;
// Equal to operator
cout << "a == b is " << (a == b) << endl;
// true
cout << "a != b is " << (a != b) << endl;
return 0;
}
Output
a == b is 0
a > b is 1
a >= b is 1
a < b is 0
a <= b is 0
a != b is 1
3. Logical Operators
These operators are used to combine two or more conditions or constraints, or to complement the
evaluation of the original condition in consideration. The result returns a Boolean value, i.e., true or
false.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
int a = 6, b = 4;
// Logical OR operator
cout << "a || b is " << (a || b) << endl;
return 0;
}
Output
a && b is 1
a || b is 1
!b is 0
4. Bitwise Operators
These operators are used to perform bit-level operations on the operands. The operators are first
converted to bit-level and then the calculation is performed on the operands. Mathematical operations
such as addition, subtraction, multiplication, etc. can be performed at the bit level for faster
processing.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
int a = 6, b = 4;
// Binary OR operator
cout << "a | b is " << (a | b) << endl;
return 0;
}
Output
a & b is 4
a | b is 6
a ^ b is 2
a<<1 is 12
a>>1 is 3
~(a) is -7
5. Assignment Operators
These operators are used to assign value to a variable. The left side operand of the assignment
operator is a variable and the right side operand of the assignment operator is a value. The value on
the right side must be of the same data type as the variable on the left side otherwise the compiler
will raise an error.
Example
Open Compiler
#include <iostream>
using namespace std;
int main() {
int a = 6, b = 4;
// Assignment Operator
cout << "a = " << a << endl;
Page 16 of 45
return 0;
}
Output
a=6
a += b is 10
a -= b is 6
a *= b is 24
a /= b is 6
Loops
Looping statements are used to traverse through some data in a contiguous manner. Loops are used
extensively in data structures like arrays, linked lists, graphs, trees and so on. These are the building
blocks of concepts like recursion, dynamic programming and graph theory, which are advanced
concepts. There are mainly three types of looping statements −
1. For loop
For loops are used to travel a certain data stucture for a specific number of times before ending the
loop at an ending condition.
Example
Open Compiler
Page 17 of 45
#include <iostream>
using namespace std;
int main() {
for(int i=0;i<6;i++){
cout<<"hello"<<endl;
}
return 0;
}
Output
hello
hello
hello
hello
hello
hello
2. While loop
While loops are used to run a looping statement until the specified condition turns false, otherwise the
loops runs continuously.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
int i=0;
while(i<6){
cout<<"hello"<<endl;
i++;
}
return 0;
}
Page 18 of 45
Output
hello
hello
hello
hello
hello
hello
3. Do-while loop
In do-while loops, the loop runs the first time on a given condition and then checks the while
statement to run further.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
int i=0;
do{
cout<<"hello"<<endl;
i++;
}while(i<6);
return 0;
}
Output
hello
hello
hello
hello
hello
hello
Page 19 of 45
1. References
References are used to create a new name for the same memory location and the value stored there.
We can create reference to any variable using ampersand($) symbol next to the variable name.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
int i=3;
int &k=i;
cout<<i<<k<<endl;
return 0;
}
Output
33
2. Pointers
Pointers are variables that are used to store the address of the variable that they point to, and the * is
used to declare a pointer to any variable.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
Page 20 of 45
int main() {
int a=4;
int *ptr=&a;
cout<<a<<ptr<<*ptr<<endl;
return 0;
}
Output
40x7ffeb2bcfb0c4
Arrays
An array is a sequence of elements of same data type that are stored in contiguous memory locations
in the storage. The array can be declared with and without the number of elements.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
int arr1[]={1,2,3,4,4,3,2,1};
int arr2[8]={0};
for(int i=0;i<8;i++){
cout<<arr1[i]<<arr2[i]<<endl;
}
return 0;
}
Output
10
20
Page 21 of 45
30
40
40
30
20
10
Multidimensional Arrays
Arrays can also be defined in more than one dimensions, with all elements of the same datatype.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
int arr[2][3]={{1,2,3},{4,4,3}};
for(int i=0;i<2;i++){
for(int j=0;j<3;j++){
cout<<arr[i][j]<<endl;
}
}
return 0;
}
Output
1
2
3
4
4
3
Functions
Page 22 of 45
Functions are parts of the code that can be called if defined previously, and help to make the code
concise and readable. Functions can be created as part of the program or in the class body as well.
The first function executed by the compiler in c++ is the main function.
The function has a name, a return type (which can also be void), input variables and a method body.
The example below showcases how functions are defined and used in c++.
Primitive Functions which are already defined in the c++ library. Examples of primitive
functions are math functions like sin(), cos(), min(), max() and so on.
User Defined Functions, which are defined as per the requirement of the user and can be
customized accordingly.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
void sum1(int &a, int &b){
b+=a;
}
int main(){
int a=10, b=12;
sum1(a,b);
cout<<b<<a<<endl;
return 0;
}
Output
2210
Math Functions
C++ being a superset of C, supports a large number of useful mathematical functions. These
functions are available in standard C++ to support various mathematical calculations.
Page 23 of 45
Instead of focusing on implementation, these functions can be directly used to simplify code and
programs. In order to use these functions you need to include a header file − <math.h> or <cmath>.
The below example shows the use of many such math functions that can be directly used instead of
complex calculations.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main() {
double x = 2.3;
cout << "Sine value of x=2.3 : " << sin(x) << endl;
cout << "Cosine value of x=2.3 : " << cos(x) << endl;
cout << "Tangent value of x=2.3 : " << tan(x) << endl;
double y = 0.25;
cout << "Square root value of y=0.25 : " << sqrt(y)
<< endl;
int z = -10;
cout << "Absolute value of z=-10 : " << abs(z) << endl;
cout << "Power value: x^y = (2.3^0.25) : " << pow(x, y)
<< endl;
x = 3.0;
y = 4.0;
cout << "Hypotenuse having other two sides as x=3.0 and"
<< " y=4.0 : " << hypot(x, y) << endl;
x = 4.56;
cout << "Floor value of x=4.56 is : " << floor(x)
<< endl;
x = -4.57;
cout << "Absolute value of x=-4.57 is : " << fabs(x)
<< endl;
x = 1.0;
Page 24 of 45
y = 12.3;
cout << "Ceiling value of y=12.3 : " << ceil(y) << endl;
x = 57.3; // in radians
cout << "Hyperbolic Cosine of x=57.3 : " << cosh(x)
<< endl;
cout << "Hyperbolic tangent of x=57.3 : " << tanh(x)
<< endl;
y = 100.0;
// Natural base with 'e'
cout << "Log value of y=100.0 is : " << log(y) << endl;
return 0;
}
Output
Object-Oriented Programming
OOPS concepts exist in C++ as well. This basically means the program can be subcategorized into
classes and objects.
1. Class
A class is a user-defined data type that has two components, the variables and the methods. The
class can be initialized using a constructor.
2. Objects
An object is an instance or a variable of the class. Objects occupy memory in the storage space.
3. Encapsulation
Encapsulation is wrapping up the data and methods together under a single class or category. For
this, classes are used.
4. Abstraction
This includes hiding details using a certain level of security.
5. Polymorphism
Using same name and body to create multiple instances of an object or method is known as
polymorphism.
1. Compile-time Polymorphism
Compile-time Polymorphism can be achieved using −
Operator overloading
Function overloading
2. Runtime Polymorphism
Function overloading
Page 26 of 45
Viral Functions
6. Inheritance
Deriving the properties of a class ( Parent class ) to another class ( Child class ) is known as
Inheritance.
File Handling
The different operations in file handling are as follows −
Open file − To open a file, use the open() method of the ofstream class.
Read a file − To read a file, use the getline() method of the ifstream class.
Write a file − Use the "<<" operator to write on a file while it is opened.
Example
#include <bits/stdc++.h>
using namespace std;
int main(){
ofstream outputFile("file1.txt");
outputFile.open("file1.txt");
if (outputFile.is_open()) {
ifstream inputFile("file1.txt");
if (inputFile.is_open()) {
string line;
while (getline(inputFile, line)) {
// Print each line
cout << line << endl;
}
// Close the file
inputFile.close();
}else {
return 0;
}
Exception Handling
When working with classes and objects, various errors and exceptions are possible due to some fault
either in the program written by the user or due to some machine fault, like memory or execution.
These errors may be fatal to the smooth execution of a program, and hence need to be handled using
try and catch blocks.
When an error occurs, C++ will normally stop and generate an error message. The technical term for
this is: C++ will throw an exception (throw an error).
Try Block − The try statement allows you to define a block of code to be tested for errors
while it is being executed.
Throw − The throw keyword throws an exception when a problem is detected, which lets us
create a custom error.
Catch Block − The catch statement allows you to define a block of code to be executed, if an
error occurs in the try block.
try {
// Block of code to try
Page 28 of 45
Example
#include <bits/stdc++.h>
using namespace std;
try {
int bmi=30;
if (bmi>28) {
cout << "You are overweight.";
} else {
throw (bmi);
}
}
catch (int x) {
cout << "You are underweight.";
cout << "Weight is: " << x;
}
Preprocessor
The preprocessors are keywords that give directions to the compiler to process the instructions
before the actual compilation starts. These begin with a ‘#’, and do not need any ‘;’ at the end as these
are not statements.
#include
#define
1. #include
It is used to include header files and libraries that are required to execute the methods and functions
used in the program. As stated earlier, the actual implementation of the method is not shown, and the
Page 29 of 45
Example
Open Compiler
#include <math.h>
#include <iostream>
int main(void){
cout<<pow(2,3);
return 0;
}
Output
2. #define
The #define preprocessor directive creates symbolic constants. The symbolic constant is called a
macro and the general form of the directive is the symbol ‘#’ followed by define statement and the
definition of the constant that needs to be defined. When this format appears in a file, all subsequent
occurrences of macro in that file will be replaced by replacement-text before the program is compiled.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
#define A 45
//defining value of A as 45
Page 30 of 45
int main(void){
int a= A;
cout<<a;
return 0;
}
Output
45
Namespaces
A namespace is used to define two functions of the same name in a program. This way, the compiler
knows which method to use when calling calling a function. Using namespace, you can define the
context in which names are defined. In essence, a namespace defines a scope.
Defining a namespace is easy. You can just write namespace followed by the code inside the method.
This function can be used inside a program by mentioning the namespace where it is from, along with
‘::’ symbol in between.
Example 1
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main () {
// Calls function from first name space.
first_space::func();
return 0;
}
Output
Inside first_space
Inside second_space
The using keyword can be used in form of a directive to direct the following code to adhere to the
mentioned namespace. The ‘std’ keyword is similarly used to mention that all of the code is going to
adhere to the standard namespace.
Example 2
Open Compiler
#include <bits/stdc++.h>
using namespace std;
}
}
return 0;
}
Output
Inside first_space
Templates
A template is a blueprint or formula for creating a generic class or a function. The library containers
like iterators and algorithms have been developed using template concept.
Class Template
Function Template
1. Class Template
Class templates can be used to define different data structures like linked lists, stack, queue, priority
queue, tree and so on. Class template can be defined in the following way −
Syntax
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
public:
Array(T a[], int s);
void show();
};
int main(){
int size=7;
int a[size] = { 12, 21, 45, 34, 19, 55, 66 };
Array<int> a1(a, 7);
a1.show();
return 0;
}
Output
Page 34 of 45
12
21
45
34
19
55
66
2. Function Template
These can be used to create generic functions using template libraries, with inbuilt functionalities.
Some examples of function templates are max(), min(), sin(), floor(), etc.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main(){
// Call minof3 for int
cout << minof3<int>(32,58,97) << endl;
// call minof3 for double
cout << minof3<double>(13.0,12.0, 17.0) << endl;
// call minof3 for char
cout << minof3<char>('g', 'e', 't') << endl;
// call minof3 for string
cout << minof3<string>("apple", "ball", "cat")<<endl;
return 0;
}
Page 35 of 45
Output
32
12
e
apple
Dynamic Memory
Memory in C++ is divided into 2 parts −
Stack Memory − All variables declared inside the function will take up memory from the
stack.
Heap Memory − This is unused memory of the program and can be used to allocate the
memory dynamically when program runs.
When you write a program, sometimes it might occur that the memory required would not be known
beforehand, and hence extra space from the heap memory would be required at runtime. This is
dynamic memory allocation, and this can be implemented using the ‘new’ keyword. After utilizing this
space, the data can be deallocated using the ‘delete’ keyword.
The malloc() function from C, still exists in C++, but it is recommended to avoid using malloc()
function. The main advantage of new over malloc() is that new doesn't just allocate memory, it
constructs objects which is prime purpose of C++.
Example
Open Compiler
#include <bits/stdc++.h>
using namespace std;
int main () {
int *ptr = NULL; // Pointer initialized with null
ptr = new int; // Request memory for the variable
return 0;
}
Output
Value of pointer : 31
Similarly, dynamic memory can be allocated while implementing arrays and classes as well. For any
more information regarding Dynamic Memory allocation- refer to this article on Dyamic Memory
Allocation.
Signal Handling
Signal handling is the process of controlling interrupt signals delivered during the execution of the
program. There are various kinds of interrupts, which can prematurely end the program and generate
different responses. For example, in Linux/Unix command line interface (CLI) the ‘CTRL+C’ command
generate the end program interrupt. Similarly, there exist many interrupts in C++ programming
language as well. These are defined in the <csignal> library.
SIGABRT
1
Abnormal termination of the program, such as a call to abort.
SIGFPE
2 An erroneous arithmetic operation, such as a divide by zero or an operation resulting in
overflow.
SIGILL
3
Detection of an illegal instruction.
SIGINT
4
Receipt of an interactive attention signal.
SIGSEGV
5
An invalid access to storage.
SIGTERM
6
A termination request sent to the program.
1. signal() Function
The signal function is provided by the <csignal> library, and is used to trap unwanted or bad interrupts
at once. Here is the usage of signal() function, which takes two inputs, first one is the signal number,
Page 37 of 45
Example
#include <csignal>
#include <iostream>
using namespace std;
int main(){
//initialize signal
signal(SIGABRT, handler_func);
while (true) {
cout << "You can't stop me !!!" << endl;
this_thread::sleep_for(chrono::seconds(1));
//this is used for delay
}
return 0;
2. raise() Function
The signal function is provided by the <csignal> library, and is used generate interrupts with their
numbers. Here is the usage of raise() function, which takes onw input which is the signal number.
Example
#include <csignal>
#include <iostream>
// terminate program
exit(signum);
}
int main(){
int i = 0;
signal(SIGABRT, signal_handler);
while (++i) {
cout << "You can't stop me !!!" << endl;
if (i == 10)
raise(SIGABRT);
}
return 0;
}
Multithreading
Multithreading is part of the operating systems concept of multitasking on a processor. Multitasking
is generally subcategorized into two parts- Process based and Thread based.
In process based multitasking, two or more processes or programs run concurrently on a processor
while executing, and it is completely dependent on the prowess of the processor to handle the tasks.
In thread based multitasking, each program is divided into threads, which can be thought of as
smaller subprograms that concurrently run on a processor and generate response together. Hence,
multiple threads combine together to become a single program. This is known as Multithreading.
In C++, there was no built-in support of multithreading before the launch of C++ 11. C++ uses POSIX
Threads, or Pthreads which are available on many Unix-like POSIX systems. The following operations
can be performed on pthreads −
Creating threads
Terminating threads
Creating threads
Threads can be created using the routine pthread_create, in the <pthread.h> library. These can be
created anywhere inside the program.
Syntax
#include <pthread.h>
pthread_create (thread, attr, start_routine, arg);
thread
1
An opaque, unique identifier for the new thread returned by the subroutine.
attr
2 An opaque attribute object that may be used to set thread attributes. You can specify a
thread attributes object, or NULL for the default values.
start_routine
3
The C++ routine that the thread will execute once it is created.
arg
4 A single argument that may be passed to start_routine. It must be passed by reference as a
pointer cast of type void. NULL may be used if no argument is to be passed.
Terminating a thread
The pthread_exit() is used to terminate a thread after it has completed its execution and is no longer
required in the program. This helps clear the space assigned to the thread in the first place.
Syntax
#include <pthread.h>
pthread_exit (status);
Example
#include <iostream>
#include <cstdlib>
#include <pthread.h>
Page 40 of 45
#define NUM_THREADS 5
int main () {
pthread_t threads[NUM_THREADS];
int rc;
int i;
if (rc) {
cout << "Error:unable to create thread," << rc << endl;
exit(-1);
}
}
pthread_exit(NULL);
}
Output
Syntax
Example
Open Compiler
#include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <unistd.h>
#define NUM_THREADS 5
tid = (long)t;
sleep(1);
cout << "Sleeping in thread " << endl;
cout << "Thread with id : " << tid << " ...exiting " << endl;
pthread_exit(NULL);
}
int main () {
int rc;
int i;
pthread_t threads[NUM_THREADS];
pthread_attr_t attr;
void *status;
Page 42 of 45
Output
Example
Open Compiler
#include <iostream>
#include <cstdlib>
#include <pthread.h>
#define NUM_THREADS 5
struct thread_data {
int thread_id;
char *message;
};
pthread_exit(NULL);
}
int main () {
pthread_t threads[NUM_THREADS];
struct thread_data td[NUM_THREADS];
int rc;
int i;
if (rc) {
cout << "Error:unable to create thread," << rc << endl;
exit(-1);
}
}
pthread_exit(NULL);
}
Output
There has been a lot of change in the world of C++ programming since its inception, and it is
becoming ever more important to be aware of the new syntax that is being introduced. This article
provides a summary of the most popular syntaxes in C++ and has been designed to lay out all the
Page 45 of 45
basics for those who are early on in their programming journey. For those who are more experienced,
this article will provide an overview of what is happening in the world of C++.