Lecture 6 - Pointers and Functions Flashcards

1
Q

data type that “points” to another value stored in memory

A

Pointers

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

marks the variable as a pointer

A

Asterisk

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

returns the variable’s address

A

Reference Pointer (&)

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

returns the value stored in a memory address

A

Dereference Pointer (*)

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

a set of statements that take inputs, does a specific task or computation to produce a certain output.

A

Functions

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

Built-in programs already available in C++, its functions are already available for use and will no longer require additional modification or programming.

A

Pre-Defined / Built-in

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

Created and modified by the user or programmer. Functions defined by programmers to suit the specifications set.

A

User-Defined

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

A built-in function in C++ by using header files or libraries where modification is not allowed

A

Pre-defined

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

A variable declared within a block and not accessible outside of that block.

A

Local Variable

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

How to declare functions?

A

dataType function_name (parameter list)

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

the variables or inputs of a function

A

parameter list

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

A variable declared outside of all the functions in a program and is accessible throughout the program.

A

Global Variable

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

it creates the function and is divided into two sections

A

Function Definition

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

defines the name of the function, the type of data to be returned, and the parameter list

A

Function Header

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

Parts of a Function Definition

A

Function Header & Function Body

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

defines the specific task to be carried out by the function. The whole function is enclosed using opening and closing
brackets

A

Function Body

13
Q

also called a function prototype. It resembles that of a function header but with a semicolon and used to show how a function should be called and is useful in instructing the main function that this specific user defined function is existing in the C++ program

A

Function Declaration

14
Q

is an expression which executes the function. If the function has
arguments, this needs input inside the parenthesis to do the particular task.

A

Function Call

15
Q

Functions which return one value to the user once it is called in the program. The return type of this type of function is the one also used in the function definition.

A

Value Returning Function

16
Q

The calling of a function requires data to be transferred forward and backwards, and if the parameter list in a function call is not empty, then data transfer will occur.

A

Exchange of Data

16
Q

Created and used just like value-returning functions except they do not return a value after the function executes. It performs a task, and then control returns back to the caller but it does not return a value.

A

Void Function

16
Q

passed to the function were copies of their values but never the variables themselves.

A

Pass by Value

17
Q

not passing a copy of its value, but we are somehow passing the variable itself to the function.

A

Pass by Reference

17
Q

A copy of value is passed to the
function

A

Call by Value

17
Q

An address of value is passed to
the function

A

Call by Reference

18
Q

specify more than one definition for a function name or an operator in the same scope

A

Function Overloading