55.4k views
0 votes
Function prototypes and function definitions look similar because they have the same function heading. In a function prototype the heading is followed by a ___, whereas in a function definition the heading is followed by a ___.

1 Answer

6 votes

Answer:

In a function prototype the heading is followed by a semicolon, whereas in a function definition the heading is followed by a function block.

Step-by-step explanation:

As the function prototype only declares the function and the function definition defines the operations in the function.

e.g:

add(int x, int y); is the prototype

add(int x, int y)

{

int sum;

sum
= x
+y;

} is the function definition.

User Srgstm
by
5.5k points