What is a function prototype used for ?
2024
What is a function prototype used for ?
- A.
To define the return type of a function
- B.
To declare the function before its definition
- C.
To specify the function's parameters
- D.
To document the function's purpose
Attempted by 164 students.
Show answer & explanation
Correct answer: B
A function prototype declares the function's name, return type, and parameter types before its definition. It allows the compiler to check for correct function calls and enables functions to be used before they are defined in the code.