KORAH CAREER HUB
INTRODUCTION TO PROGRAMMING WITH C++
WELL CURATED C++ NOTES TO HELP YOU UNDERSTAND C++
AS WELL AS PROGRAMMING
PREPARED BY: KORAH CAREER HUB
2026
, THE LIST OF TABLES THAT ARE IN THESE NOTES
Table 1.1: Well-Known High-Level Programming Languages ......................................... 6
Table 2.1: Primitive Data Types .................................................................................... 26
Table 2.2: Type Modifiers .............................................................................................. 27
Table 2.3: Basic Fundamental Data Types in C++ ........................................................ 27
Table 2.4: C++ Reserved Words ................................................................................... 39
Table 3.1: Algebraic and C++ Multiplication Expressions.............................................. 48
Table 3.2: Algebraic and C++ Expressions ................................................................... 49
Table 3.3: Combined Assignment Operators ................................................................ 51
Table 3.4: Logical AND ................................................................................................. 53
Table 3.5: Logical OR .................................................................................................... 54
Table 3.6: Logical NOT ................................................................................................. 55
Table 4.1: Flowchart Symbols ....................................................................................... 82
Table 5.1: Where To Place a Function Definition in a Program .................................. 131
Table 8.1: Selection Sort ............................................................................................. 197
Table 8.2: Bubble Sort ................................................................................................. 199
Table 8.3: Insertion Sort .............................................................................................. 202
Table 10.1: Union vs Structure .................................................................................... 240
Table 11.1: Two-Dimensional String Array .................................................................. 258
Table 12.1: Composition vs Inheritance ...................................................................... 304
Table 12.2: Key Differences: Inheritance vs Composition .......................................... 306
ii
, LIST OF FIGURES
Figure 1.1: Source code to target code sequence ........................................................ 11
Figure 1.2: Process of translating a C++ source file into an executable file .................. 12
Figure 1.3: Screen from the DEV C++ IDE .................................................................... 14
Figure 3.1: Mathematical expression............................................................................. 45
Figure 3.2: Conditional operator .................................................................................... 56
Figure 3.3: Operator precedence .................................................................................. 59
Figure 4.1: Flowchart for a program that sum two given numbers ................................ 83
Figure 5.1: Sequential program control structures general flowchart ............................ 91
Figure 5.2: Simple if Statement Program Control Structures General Flowchart ....... 95
Figure 5.3: The if-else Statement Program Control Structures General Flowchart . 98
Figure 5.4: if-else if statement program control structures general flowchart .... 101
Figure 5.5: CASE statement program control structures general flowchart ................. 107
Figure 5.6: While … do Loop general flowchart ...................................................... 109
Figure 5.7: Do … while loop general flowchart........................................................ 111
Figure 5.8: Repeat … until loop general flowchart .............................................. 113
Figure 5.9: For loop general flowchart ........................................................................ 115
Figure 6.1: Value Parameters ..................................................................................... 139
Figure 6.2: Value parameters and memory location .................................................... 140
Figure 6.3: Reference Parameters .............................................................................. 140
Figure 7.1: Graphical Representation of an Array of n Numbers ................................ 170
Figure 7.2: hours array - enough memory to hold six int value ................................. 171
Figure 7.3: 2D array of 3 students with 5 grades ......................................................... 174
Figure 9.1: Reference and Dereference Operators ..................................................... 209
Figure 9.2: Pointer Operators ...................................................................................... 209
Figure 9.3: Pointer Arithmetic- integer variable ........................................................... 215
iii
, Figure 9.4: Pointer Arithmetic- double variable ........................................................... 215
Figure 9.5: Pointer of Pointer illustration ..................................................................... 216
Figure 11.1: Graphical representation of Null-terminated strings ................................ 252
Figure 14.1: File streams ............................................................................................394
Figure 15.1: Document preparation process ..............................................................421
CONTENT TO BE LEARNT
UNIT 1: INTRODUCTION TO PROGRAMMING ............................................................
Introduction .................................................................................................................. 1
Unit outcomes .............................................................................................................. 1
Key terms ..................................................................................................................... 1
1.1 Computer Programming ......................................................................................... 1
1.2 Programming Languages ....................................................................................... 2
1.3 Software Development Tools ................................................................................. 8
1.4 Programming Stages ........................................................................................... 14
Unit summary ............................................................................................................. 16
UNIT 2: INTRODUCTION TO C++ PROGRAMMING ...................................................
18
Introduction ................................................................................................................ 18
Unit outcomes ............................................................................................................ 18
Key terms ................................................................................................................... 18
2.1 C++ Program Structure ........................................................................................ 19
2.2 Data Types and Variables .................................................................................... 25
Unit summary ............................................................................................................. 41
UNIT 3: OPERATORS AND EXPRESSIONS ...............................................................
42
Introduction ................................................................................................................ 42
iv