Polymorphism: Function & Operator Overloading

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

flashcard set

Earn XP

Description and Tags

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.

Last updated 10:31 PM on 5/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

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.

2
New cards

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.

3
New cards

Run-Time Polymorphism

Also called Dynamic Polymorphism, this type is determined during program execution and is more flexible but slightly slower than static polymorphism.

4
New cards

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.

5
New cards

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.

6
New cards

Compile-time

The period when the compiler translates human-readable source code (.cpp.cpp files) into machine code (an executable .exe.exe file) while checking for syntax and type safety.

7
New cards

Runtime

The period when the compiled executable is running on a CPU, allocating RAM and interacting with the user or OS.

8
New cards

Segmentation Fault

A type of Runtime Error that occurs if the code attempts to access a memory address it does not own.

9
New cards

Unary Operators

Operators that operate on a single operand, such as increment (++++), decrement (--), unary minus (-), and logical not (!!).

10
New cards

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.

11
New cards

Standard Room price

In the guesthouse booking system scenario, this room type is priced at P300P300.

12
New cards

Deluxe Room price

In the guesthouse booking system scenario, this room type is priced at P500P500.

13
New cards

VIP Room price

In the guesthouse booking system scenario, this room type is priced at P1000P1000.

14
New cards

Overloading Return Type Restriction

The rule stating that you cannot overload a function using ONLY the return type; it will cause a compile error.

15
New cards

Compile-time Error

An error such as a missing semicolon or non-existent variable that prevents an executable file from being created.