Level 53
Level 55
13 words 0 ignored
Ready to learn
Ready to review
Ignore words
Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.
Ignore?
Function
a group of statements that together perform a task
main()
main function
Defining a Function
return_type function_name( parameter list ) { body of the function }
a function header and a function body
A function definition consists of
Return Type
the data type of the value the function returns.
Function Name
the actual name of the function
Parameters
When a function is invoked, you pass a value to the parameter. This value is referred to as actual parameter or argument
Function Body
contains a collection of statements that define what the function does
A function declaration
tells the compiler about a function name and how to call the function
function declaration syntax
return_type function_name( parameter list );
Calling a Function
pass the required parameters along with the function name, and if the function returns a value, then you can store the returned value
Call by value
This method copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument.
Call by reference
This method copies the address of an argument into the formal parameter.