C++ Functions Flashcards

1
Q

IT IS A SET OF INSTRUCTIONS THAT IS DESIGNED TO PERFORM A SPECIFIC TASK.

A

Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A PROGRAM TO BE BROKEN INTO SMALL TASKS.

A

Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

THESE ARE SUBPROGRAMS THAT DO NOT EXECUTE UNTIL THEY CALLED

A

Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TYPES OF FUNCTION

A
  1. PRE-DEFINED FUNCTIONS
  2. USER DEFINED FUNCTIONS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • ALREADY BEEN DEFINED AS A PART OF THE LANGUAGE
A

PRE-DEFINED FUNCTIONS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • FUNCTIONS CREATED BY A USER.
A

USER DEFINED FUNCTIONS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

RETURN STATEMENT

A

CAUSES THE VALUE TO BE RETURNED TO THE CALLING FUNCTION.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

WHAT IS A VALUE RETURNING FUNCTION?

A

Value returning functions are used when only one result is returned and that result is used directly in an expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

a function declaration that does not include the body of the function.

A

FUNCTION PROTOTYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

FUNCTION DEFINITION

A

A FUNCTION DECLARATION THAT INCLUDES THE BODY OF THE FUNCTION. IT IS THE ACTUAL CODE OF THE FUNCTION AND ALWAYS OUTSIDE THE main( ) FUNCTION.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

IT IS USED WHEN INPUT/OUTPUT IS PERFORMED AND MORE THAN ONE VALUE IS TO BE RETURNED BY MODIFYING ONE OR MORE PARAMETERS RATHER THAN USING A RETURN STATEMENT.

A

VOID FUNCTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A VOID FUNCTION DOES NOT RETURN A VALUE TO ITS CALLER.

A

VOID FUNTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

LOCAL VARIABLE

A

A variable declared within a block and not accessible outside of that block. When the function ends (returns) all of its local variables are destroyed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A variable declared outside of all the functions in a program.

A

GLOBAL VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When you send a parameter to a function and its value will NOT BE MODIFIED, use a value parameter. When the function is CHANGING the actual parameter, such as in an input function, use a reference parameter.

A

PARAMETERS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A formal parameter that receives a copy of the contents of the corresponding argument (actual parameter) AND RETURNS A SINGLE VALUE.

A

VALUE PARAMETER

17
Q

A formal parameter that receives the address (location in memory) of the corresponding argument (actual parameter). A reference parameter is noted with an ampersand (&) following the data type of the formal parameter AND CAN RETURN A MULTIPLE VALUES.
IT ALLOWS THE CALLED FUNCTION TO DIRECTLY ALTER THE VARIABLES VALUE.

A

REFERENCE PARAMETER

18
Q

RECURSION

A

The process in which a function calls itself is known as recursion and the corresponding function is called the recursive function.