What does a C++ function declaration specify?
A function declaration, or prototype, tells the compiler the function’s name, return type, and parameter types without providing its body.
Study 05 Functions with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does a C++ function declaration specify?
A function declaration, or prototype, tells the compiler the function’s name, return type, and parameter types without providing its body.
What is a function definition?
A function definition supplies the complete implementation, including the function body and its statements.
How do parameters differ from arguments?
A parameter is a variable in a function declaration or definition; an argument is the actual value supplied when the function is called.
What happens when an argument is passed by value?
By-value parameters receive copies, so changing the parameter inside the function does not change the caller’s original variable.
What can a reference parameter do?
A reference parameter, such as int& value, can modify the caller’s variable directly.
Why use a const reference parameter?
A const reference avoids copying while preventing the function from modifying the referenced argument.
What does return do in a C++ function?
The return statement ends a function and can send a value back to its caller. A void function may use return; only to exit early.
What does void mean as a function return type?
A function with return type void does not return a value to its caller.
What happens during a function call?
When called, a function’s parameters are initialized from the arguments, its body executes, and control returns to the statement after the call.
What determines a local variable’s scope?
A local variable can be used from its declaration through the end of its enclosing block; it is unavailable outside that scope.
Why can a local variable reset on every call?
Each ordinary function call creates independent local variables, so a local count initialized to zero prints 1 on every call after incrementing.
What makes two C++ functions overloads?
Function overloading permits the same name for functions whose parameter lists differ in number, types, or type order.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.