Search Header Logo

C++ Pointers and Arrays Quiz

Authored by Fidaa Abed

Computers

12th Grade

Used 5+ times

C++ Pointers and Arrays Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What operator is used to get the address of a variable in C++?

*

&

->

%

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a pointer variable store?

Value of a variable

Address of another variable

Both value and address

None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the address of an array passed to a function in C++?

Automatically

Explicitly using &

As a reference

As a value

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements correctly declares a pointer to an integer?

int ptr*;

int* ptr;

int ptr;

ptr int;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the indirection operator (*) do when applied to a pointer?

Prints the address of the pointer

Points to another pointer

Accesses the value the pointer points to

Creates a new pointer

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following can hold the address of an integer?

int*

float*

char*

double*

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given int x = 25; int *ptr = &x;, what will *ptr output?

Memory address of x

Value of x

Undefined behavior

0

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?