functions and array Flashcards
is a named, independent section of C
code that performs a specific task and optionally returns a value to the calling statement.
Functions
two types of function in C Programming
Standard Library functions and User-defined functions
built-in functions in C programming.
standard library functions
Functions that are created by the user are also known as
user-defined functions
WHY USE FUNCTION?
Function code is reusable. Functions make program smaller. Functions make program easier to write. Functions lead to improved commenting and
readability. Functions make program easier to maintain.
The first line of a function is called
function prototype declaration
The value passed by the function call statement is called
arguments
the function ________ accepts two
arguments.
double_it
The arguments passed into a function are known as
the function’s
parameters
This statement indicates that the function is to return the value of expression back to the calling
function.
returning values
There are two ways to pass parameters to functions:
call by value and call by reference
Types of functions
Non-returning functions without parameters
Non-returning functions with parameters
Returning functions without parameters
Returning functions with parameters
An outer block variable name is valid in an inner block unless block redefines it.
Function Variables
As we know variables which are declared within the bounds of a function or block are referred as
local variables or internal variables
Variables may also be declared outside of any function block, in the same source file.
global variables or external variables