1/38
Comprehensive vocabulary flashcards covering C++ function mechanics, array manipulation, vectors, and searching and sorting algorithms.
Function
A collection of statements that performs a specific task and breaks programs into manageable units or modules.
Function Definition
The complete block of code that contains the function header and the statements that make up the function.
Function Prototype
A declaration that specifies the function's name, return data type, and parameter data types, eliminating the need to define the function prior to all calls.
Function Call
A program statement that invokes and causes a function to execute, transferring program control to that function.
Parameter
A special-purpose variable declared inside the parentheses of a function definition header that receives incoming information.
Argument
A value or information passed to a function within the parentheses of a function call.
return Statement
A statement that causes a function to end immediately and optionally passes a single value back to the calling function.
Local Variable
A variable defined inside a function that is accessible only within that function, does not persist between calls, and is not initialized to zero by default.
Global Variable
A variable declared outside of all functions, accessible throughout the entire program, and initialized to zero by default.
Static Local Variable
A variable defined inside a function that persists its value between function calls and is initialized only once, the first time the function is called.
Default Argument
An argument passed automatically to a parameter when the actual argument is omitted from the function call, typically specified in the function prototype or header.
Reference Parameter
A parameter variable declared with an ampersand that references the caller's original argument, allowing the function to modify the argument directly.
Overloaded Functions
Two or more functions that share the same name within a program but have different parameter lists.
exit()
A function that causes a program to terminate immediately, regardless of which function or control mechanism is currently executing.
EXIT_SUCCESS and EXIT_FAILURE
Named constants passed to the exit() function to signal successful completion or abnormal termination of a program.
Stub
A dummy function called in place of the actual function it represents, used during program testing and development.
Array
A data structure that stores a collection of multiple values of the same data type in contiguous memory.
Element
An individual value contained inside an array, accessed via the array name combined with an index value.
Subscript
An integer index enclosed in brackets used to identify and access an individual element in an array, beginning with 0 in C++.
Size Declarator
A constant integer expression with a value greater than 0 specified inside brackets during array definition to declare the total number of elements.
Initialization List
A comma-separated series of starting values enclosed in braces used to populate array elements upon declaration.
Implicit Array Sizing
Omitting the size declarator in an array definition while providing an initialization list, causing the compiler to automatically determine the array size.
Range-Based for Loop
A specialized loop that iterates sequentially across every element of an array or vector using a built-in range variable.
Structured Binding Declaration
A C++ statement, such as auto [n1, n2, n3] = narray;, used to unpack the individual elements of an array into separate variables.
Two-Dimensional Array
An array structured logically as rows and columns, referenced using a row subscript followed by a column subscript, requiring all dimensions after the first to be specified in function parameter lists.
Vector
A standard template library container object that behaves like an array but automatically expands and adjusts its size to accommodate new elements.
push_back()
A vector member function used to insert a new element onto the end of a vector object.
pop_back()
A vector member function used to remove the last element from a vector.
size()
A vector member function that returns the total count of elements currently stored in the vector.
empty()
A vector member function that returns true if the vector contains zero elements, and false otherwise.
Search Algorithm
A method used to locate a specific item of information within a larger collection of data, such as an array or vector.
Linear Search
A simple search algorithm that uses a loop to examine array elements sequentially one by one until a match is found or the end of the array is reached.
Binary Search
An efficient search algorithm that operates on sorted data by beginning at the middle element and repeatedly dividing the search range in half.
Sorting Algorithm
A technique designed to rearrange an unsorted collection of data into an orderly sequence, such as ascending or descending order.
Ascending Order
An arrangement of sorted data values ordered sequentially from lowest value to highest value.
Descending Order
An arrangement of sorted data values ordered sequentially from highest value to lowest value.
Bubble Sort
An iterative sorting algorithm that repeatedly compares pairs of adjacent elements and swaps them if they are out of order, bubbling smaller or larger elements to their destination.
Selection Sort
A sorting algorithm that locates the smallest or largest value in the unsorted portion of an array and swaps it into its correct position, typically making fewer swaps than bubble sort.
Swap Operation
A procedure that exchanges the values of two variables, requiring reference parameters when implemented as a standalone function and a temporary variable to avoid data overwriting.