1/41
Vocabulary flashcards covering C++ functions, header files, I/O, string & math functions, parameter passing, scope, and character utilities.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Modular Programming
A programming approach that breaks a program into smaller, manageable, reusable modules (functions); reduces code size, errors, and complexity.
Header File
A file containing grouped function declarations (prototypes) that can be included in programs, e.g.,
Function (C++)
A named unit of statements that performs a specific task; may be predefined or user-defined.
Predefined (Built-in) Function
A function already written, compiled, and stored in a header file, e.g., sqrt(), toupper().
User-Defined Function
A function written by the programmer to accomplish a specific task, e.g., main().
Parameter / Argument
Data supplied within the parentheses of a function call or definition that the function uses while executing.
cstdio
Header file that provides console character I/O functions like getchar() and putchar().
getchar()
Console input function that reads one character from the keyboard and returns it.
putchar()
Console output function that prints the character (or ASCII value) passed as its argument.
Stream Function
I/O function that moves a stream of bytes between memory and devices such as keyboard or monitor (e.g., get(), getline()).
get()
cin.get(); Input stream function that reads a single character or a string into a char array.
getline()
cin.getline(); Input stream function that reads a line (string) up to a delimiter, length, or Enter key.
put()
cout.put(); Output stream function that writes one character (or ASCII value) to standard output.
write()
cout.write(); Output stream function that prints a specified number of characters from a string.
cstring
Header file that provides C-style string manipulation functions like strcpy() and strlen().
strlen()
Returns the length (number of characters) of a string; return type int.
strcpy()
Copies one string into another: strcpy(dest, src).
strcat()
Appends one string to the end of another: strcat(dest, src).
strcmp()
Compares two strings and returns 0 if equal, negative if first < second, positive if first > second.
strcmpi()
Case-insensitive version of strcmp(); ignores letter case during comparison.
cmath
Header file that provides mathematical functions such as pow() and sqrt().
abs()
Returns the absolute value of an integer argument.
fabs()
Returns the absolute value of a floating-point argument.
sqrt()
Returns the square root of a number.
pow()
Calculates a number raised to a given power: pow(base, exponent).
return Statement
Sends a function's result back to the calling code and transfers control to that point.
void Function
A function declared with return type void; it does not return any value.
Actual Parameter
The real data (constants, variables, expressions) supplied in a function call.
Formal Parameter
Placeholder variable listed in a function definition that receives the value of an actual parameter.
Function Prototype
Declaration that informs the compiler about a function’s name, return type, and parameters before its use.
Call by Value
Parameter passing method where a copy of each actual argument is sent to the function; changes inside do not affect originals.
Call by Reference
Parameter passing method where the function receives references to actual arguments; changes inside affect originals.
Default Argument
An initial value assigned to a parameter in a function definition, allowing calls to omit that argument.
Scope (Lifetime)
The part of a program where a variable or function is accessible; ends when execution leaves that block or function.
Local Variable
Variable declared within a function/block; accessible only inside that scope.
Global Variable
Variable declared outside all functions; accessible throughout the entire program.
Local Function
Function declared inside another function; its scope is limited to the enclosing function.
Global Function
Function declared outside any other function; callable from anywhere in the program after its declaration.
isalnum()
Character function that checks whether a character is alphanumeric (letter or digit).
isalpha()
Character function that checks whether a character is an alphabetic letter.
toupper()
Converts a lowercase letter to uppercase.
tolower()
Converts an uppercase letter to lowercase.