Ready to practice?
Sign up to access interactive coding exercises and track your progress.
Back to C++ Programming Fundamentals
Lesson 1 of 15
Beginner
25 minutes
Introduction to C++ basics
Overview of fundamental C++ concepts and terminology you'll master in this chapter.
C++ Basics - Terminology Reference
This lesson provides a comprehensive reference of all the key C++ terminology you'll encounter throughout Chapter 1. Think of it as your programming vocabulary guide - these are the essential terms every C++ programmer needs to know.
Complete Terminology Guide
Program Structure & Execution
Term | Definition | Example |
---|---|---|
Program | A set of instructions that tells the computer what to do | A complete C++ application |
Statement | A single instruction that tells the computer to perform some action, must end with a semicolon | int x = 5; |
Function | A named group of statements that perform a specific task | main() , calculateArea() |
main() function | The special function where program execution begins; every C++ program must have one | int main() { return 0; } |
Preprocessor | A tool that processes directives (like #include) before compilation | Handles #include <iostream> |
Header file | A file containing declarations that can be included in programs | iostream , string |
#include | Preprocessor directive that includes library functionality | #include <iostream> |
return 0 | Statement that tells the computer the program finished successfully | End of main function |
Compilation | The process of converting source code into executable program | Converting .cpp to .exe |
Compiler | Tool that translates C++ code into machine language | g++, MSVC, clang |
Data Storage & Variables
Term | Definition | Example |
---|---|---|
Object | A piece of memory that can store values | Any variable in memory |
Variable | A named object that gives us a way to refer to stored data | int age; |
Data type | Defines what kind of data can be stored | int , double , char |
Declaration | Tells the compiler about a variable's type and name | int age; |
Definition | Actually creates the variable and allocates memory | Same as declaration in C++ |
Initialization | Giving a variable its first value when it's created | int age = 25; |
Assignment | Storing a new value in an existing variable using the = operator | age = 26; |
Data Types
Term | Definition | Range/Usage |
---|---|---|
int | Data type for whole numbers | -2,147,483,648 to 2,147,483,647 |
double | Data type for high-precision decimal numbers | 15-16 digits precision |
char | Data type for single characters, enclosed in single quotes | 'A' , '5' , ' ' |
bool | Data type for true/false values | true or false |
string | Data type for text of any length, requires #include <string> | "Hello World!" |
float | Data type for decimal numbers with less precision than double | 6-7 digits precision |
short | Data type for smaller integers | -32,768 to 32,767 |
long | Data type for larger integers | Platform dependent |
Values & Operations
Term | Definition | Example |
---|---|---|
Literal | A fixed value written directly in code that never changes | 5 , 3.14 , "hello" |
Integer literal | Whole numbers written directly in code | 5 , -3 , 0 |
Floating-point literal | Decimal numbers written directly in code | 3.14159 , 0.5 |
String literal | Text enclosed in double quotes | "Hello World!" |
Operator | A symbol that performs an operation on values | + , - , * , / , = |
Operand | The values that operators work with | In 5 + 3 , both 5 and 3 |
Expression | A combination of values, variables, and operators that produces a result | x + y * 2 |
Evaluation | The process of calculating an expression's result | 2 + 3 * 4 becomes 14 |
Precedence | Rules determining which operations are performed first in expressions | * before + |
Common Operators
Term | Symbol | Description | Example |
---|---|---|---|
Assignment operator | = |
Assigns a value to a variable | x = 5; |
Addition | + |
Mathematical addition | 5 + 3 |
Subtraction | - |
Mathematical subtraction | 10 - 4 |
Multiplication | * |
Mathematical multiplication | 6 * 7 |
Division | / |
Mathematical division | 15 / 3 |
Output operator | << |
Sends values to std::cout | cout << "Hello"; |
Input operator | >> |
Reads values from std::cin | cin >> age; |
Input & Output
Term | Definition | Usage |
---|---|---|
iostream | Library that provides input and output functionality | #include <iostream> |
std::cout | Console output stream for displaying text on screen | std::cout << "Hello"; |
std::cin | Console input stream for reading data from keyboard | std::cin >> age; |
std::endl | End line manipulator that creates a new line and flushes output buffer | cout << "Hi" << endl; |
Buffer | Temporary storage area for input/output data | Internal I/O storage |
Chaining | Using multiple << or >> operators in sequence | cout << "Age: " << age; |
Code Documentation & Style
Term | Definition | Example |
---|---|---|
Comment | Text in code that explains what the code does, ignored by compiler | // This is a comment |
Single-line comment | Comment that spans one line, uses // | // Calculate total |
Multi-line comment | Comment that can span multiple lines, uses /* */ | /* This spans multiple lines */ |
Pseudocode | Human-readable blueprint for developing software | Plain English program steps |
Whitespace | Spaces, tabs, and newlines used to format code for readability | Spaces between words |
Indentation | Consistent spacing used to show code structure and nesting | 4 spaces or 1 tab |
Formatting | The visual arrangement of code to improve readability | Consistent spacing |
Naming & Conventions
Term | Definition | Example |
---|---|---|
Identifier | A name used to identify variables, functions, etc. | studentAge , calculateTotal |
Keyword | A word reserved by C++ with special meaning, cannot be used as variable names | int , return , if , while |
camelCase | Naming convention where first word is lowercase, subsequent words capitalized | studentAge , totalScore |
snake_case | Naming convention using underscores between words | student_age , total_score |
Case sensitive | C++ distinguishes between uppercase and lowercase letters in names | Age ≠ age |
Initialization Types
Term | Syntax | Description |
---|---|---|
Copy initialization | int x = 5; |
Initialization using equals sign |
Direct initialization | int x(5); |
Initialization using parentheses |
Uniform initialization | int x{5}; |
Modern initialization using braces |
Error Prevention & Safety
Term | Definition | Why It Matters |
---|---|---|
Undefined behavior | When program behavior is unpredictable due to programming errors | Can crash programs or produce wrong results |
Uninitialized variable | A variable declared without an initial value, contains garbage data | Causes unpredictable behavior |
Garbage value | Random data left in memory from previous use | Found in uninitialized variables |
Essential Symbols
Symbol | Name | Usage | Example |
---|---|---|---|
; | Semicolon | Required at end of most statements | int x = 5; |
{ } | Curly braces | Group code together, define code blocks | int main() { } |
" " | Double quotes | Enclose string literals | "Hello World!" |
' ' | Single quotes | Enclose character literals | 'A' |
( ) | Parentheses | Function calls, grouping expressions | main() , (x + y) |
Program Development Process
Term | Definition | When Used |
---|---|---|
Algorithm | Step-by-step procedure for solving a problem | Before writing code |
Testing | Process of verifying that a program works correctly with different inputs | After writing code |
Debugging | Process of finding and fixing errors in code | When problems occur |
Iterative development | Approach of starting simple and gradually adding features | Throughout development |
How to Use This Reference
- Before each lesson - Review terms that will appear
- During lessons - Look up unfamiliar terms quickly
- After lessons - Test your understanding of terminology
- Before quizzes - Study definitions for assessment prep
Study Tips
💡 Mastering Terminology
• Use terms in sentences - Practice explaining concepts
• Connect related terms - Understand how concepts link together
• Practice with examples - See terms used in actual code
• Use terms in sentences - Practice explaining concepts
• Connect related terms - Understand how concepts link together
• Practice with examples - See terms used in actual code
Ready for the Quiz?
Now that you have the complete terminology reference, you're ready to test your understanding with the chapter quiz.
🎯 Next Step
Take the quiz to test your knowledge of these fundamental C++ terms. Don't worry if you need to refer back to this guide - that's what it's for!
Take the quiz to test your knowledge of these fundamental C++ terms. Don't worry if you need to refer back to this guide - that's what it's for!
Introduction to C++ basics - Quiz
Test your understanding of the lesson.
19 questions
10 minutes
60% to pass
Lesson Discussion
Share your thoughts and questions