
C++ Pointers and Memory Management Quiz
Authored by MAHANI BINTI ZAKARIA (POLIMAS)
Information Technology (IT)
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following correctly declares a pointer to an integer in C++?
int pointer;
int *pointer;
pointer int*;
int &pointer;
Answer explanation
To declare a pointer to an integer, we use after the data type: int pointer;. This means pointer can store the memory address of an integer.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
num
10
ptr
&num
Answer explanation
To declare a pointer to an integer, we use after the data type: int pointer;. This means pointer can store the memory address of an integer.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used to get the address of a variable in C++?
*
&
@
#
Answer explanation
The ampersand (&) is used to get the memory address of a variable. For example, &x gives the address of variable x.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the relationship between a pointer and an array in C++?
Pointers cannot access array elements.
A pointer can point to only the last element of the array.
Array name is a constant pointer to the first element.
Arrays do not work with pointers.
Answer explanation
In C++, the name of the array acts like a pointer to the first element. That’s why you can use pointer arithmetic to access array elements.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the new and delete operators in C++?
To perform multiplication and division.
To create and remove functions.
To allocate and free memory during runtime.
To declare variables.
Answer explanation
The new operator is used to allocate memory dynamically (during program running time), and delete is used to free that memory when it is no longer needed.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
G9- Problem Solving Stages Quiz
Quiz
•
9th Grade - University
10 questions
Modelo OSI e TCP/IP (2)
Quiz
•
10th Grade - University
10 questions
Refresh Python
Quiz
•
University
10 questions
QUIZ 2 PLC
Quiz
•
10th Grade - University
10 questions
Data Management and Storage
Quiz
•
University
10 questions
VertexR Session
Quiz
•
University
10 questions
Penilaian Operasi Komputer Dasar
Quiz
•
7th Grade - University
10 questions
Pemrograman & Aplikasi Mikrokontroler (Pengenalan IDE)
Quiz
•
11th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University