C++ Pointers Quiz

C++ Pointers Quiz

12th Grade

7 Qs

quiz-placeholder

Similar activities

C++ Quiz 4: Arrays and Vectors

C++ Quiz 4: Arrays and Vectors

7th - 12th Grade

7 Qs

JAVA array

JAVA array

12th Grade - University

10 Qs

Linked List

Linked List

12th Grade

10 Qs

Linguaggio C - Array, Allocazione dinamica

Linguaggio C - Array, Allocazione dinamica

11th - 12th Grade

10 Qs

AP Computer Science

AP Computer Science

12th Grade

10 Qs

Linguaggio C - Ricorsione

Linguaggio C - Ricorsione

11th - 12th Grade

7 Qs

Unit 6 Computer Science

Unit 6 Computer Science

10th - 12th Grade

5 Qs

Белгіленген сипаттары бар элементті іздеу

Белгіленген сипаттары бар элементті іздеу

9th - 12th Grade

10 Qs

C++ Pointers Quiz

C++ Pointers Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Fidaa Abed

Used 2+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a pointer in C++?

A) A type of C++ operator

B) A variable that stores the address of another variable

C) A function that returns an integer

D) A memory allocation technique

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to get the address of a variable?

A) *

B) &

C) #

D) %

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you access the value stored in the address a pointer p is pointing to?

A) &p

B) *p

C) #p

D) p&

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid pointer arithmetic operation?

A) ptr + 5

B) ptr * 3

C) ptr % 2

D) ptr / 4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is correct about pointer types in C++?

A) A pointer to an integer can hold the address of a float.

B) Different types of pointers have different sizes.

C) All pointers in C++ have the same size regardless of datatype.

D) Pointers of different types have different default values.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? cppCopy code int x = 10; int *p = &x; cout << *p;

A) A memory address

B) 10

C) An error message

D) Undefined

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If arr is an array of integers, which statement is correct?

A) *(arr + 1) gives the first element of the array.

B) *(arr + 1) gives the second element of the array.

C) *(arr + 1) gives the address of the first element of the array.

D) *(arr + 1) is undefined.

Discover more resources for Computers