1/14
This set of vocabulary flashcards covers concepts from the C++ Polymorphism lecture, including function and operator overloading, compile-time vs run-time differences, and unary vs binary operator types.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Polymorphism
The ability of a function, operator, or an object to have a single name but take on many forms, allowing it to perform different tasks based on context.
Compile-Time Polymorphism
Also called Static Polymorphism, this is decided before the program runs and is faster because the compiler knows which function to call based on the number or type of arguments.
Run-Time Polymorphism
Also called Dynamic Polymorphism, this type is determined during program execution and is more flexible but slightly slower than static polymorphism.
Function Overloading
A C++ feature allowing functions to share the same function name but different parameter lists, either by changing the number of arguments or the type of arguments.
Operator Overloading
A type of compile-time polymorphism providing the mechanism to add special, user-defined meanings to operators like +, − , ∗ and / when used with class objects.
Compile-time
The period when the compiler translates human-readable source code (.cpp files) into machine code (an executable .exe file) while checking for syntax and type safety.
Runtime
The period when the compiled executable is running on a CPU, allocating RAM and interacting with the user or OS.
Segmentation Fault
A type of Runtime Error that occurs if the code attempts to access a memory address it does not own.
Unary Operators
Operators that operate on a single operand, such as increment (++), decrement (−−), unary minus (−), and logical not (!).
Binary Operator Overloading
A technique where a single operator performs functionalities using two operands, internally represented as the left object calling a function with the right object passed as a parameter.
Standard Room price
In the guesthouse booking system scenario, this room type is priced at P300.
Deluxe Room price
In the guesthouse booking system scenario, this room type is priced at P500.
VIP Room price
In the guesthouse booking system scenario, this room type is priced at P1000.
Overloading Return Type Restriction
The rule stating that you cannot overload a function using ONLY the return type; it will cause a compile error.
Compile-time Error
An error such as a missing semicolon or non-existent variable that prevents an executable file from being created.