Search Header Logo

LZECE431_Topic5

Authored by Dr Zaini

Computers

University

Used 2+ times

LZECE431_Topic5
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a pointer store?

a) The value of the variable it points to.

b) The memory address of the variable it points to.

c) Both the value and memory address of the variable it points to.

d) None of the above.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. In C++, a reference is:

a) A new variable with a separate memory address.

b) Another name for an existing variable.

c) A type of pointer.

d) Not allowed in C++.

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

When a function receives parameters by value (Choose 2):

a) The function receives the values of the arguments.

b) The function receives the memory addresses of the arguments.

c) Changes made to the parameters inside the function do not affect the original values.

d) The function can modify the original values directly.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is passed to a function when using pass by pointer?

a) The values of the arguments.

b) The memory addresses of the arguments.

c) A copy of the arguments.

d) The reference to the function.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a pass by reference function, changes made to the parameters inside the function:

a) Affect the original values.

b) Do not affect the original values.

c) Create new variables.

d) Result in a compilation error.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. What is a similarity between arrays and pointers in C++?

a) Both cannot be used as function parameters.

b) Both can be used to store multiple values.

c) Both have a fixed size.

d) Both can only store integers.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When passing an array to a function in C++, what is actually passed?

a) The entire array.

b) The memory address of the first element.

c) A copy of the array.

d) The size of the array.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?