Quiz 9: Pointer
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Xin Yang
Used 51+ times
FREE Resource
Enhance your content in a minute
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The expression:
int *p = new int[20];
allocates 20 integers and assigns the base address to p
allocates 20 integers off the stack local to a block
reads in 20 integer values from cin
allocates an integer of size 20 bytes
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which form of the operator delete would you use to deallocate free store memory allocated by this statement:
Students *student_list = new Students[size];
delete [] student_list
delete student_list
delete [] students
delete students[size]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly displays the memory address of the variable named menu?
int menu = 23;
cout << *menu;
cout << menu;
cout << &menu;
cout << &menu*;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the variable i contain after the following code executes?
int i = 17;
int *p = &i;
*p = 98;
98
17
81
0
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Allocation of memory storage for statically allocated variables occurs during ________
while memory allocation for dynamically allocated variables occurs during ___________.
(load time) and (compile time)
(load time) and (run time)
(run time) and (compile time)
(compile time) and (load time)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given:
int *p1;
int *p2;
p1 = new int;
p2 = p1;
delete p1;
p1 = NULL;
Which of the following best describe the current situation with p2?
p2 is pointing at where p1 is pointing at.
p2 is not pointing at any memory location.
p2 is a dangling pointer.
p2 is also assigned value NULL.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose the following structure and variables are declared:
struct Student {
string name;
string email;
};
Student john;
Student* p = &john;
Which of the following statements print the student john's email?
cout << p.email;
cout << p[email];
cout << john->email;
cout << p->email;
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
12 questions
UTS Semester 1 Informatika 2024/2025
Quiz
•
8th Grade - University
10 questions
Programming in C
Quiz
•
University
15 questions
SENATIC Parcial Guía 3_PseInt
Quiz
•
10th Grade - University
10 questions
T02: Python - The Basics
Quiz
•
University
15 questions
LATIHAN SOAL PEMROGRAMAN
Quiz
•
9th Grade - University
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
17 questions
Lección1 - JavaScript
Quiz
•
1st Grade - Professio...
10 questions
2025 python class first quiz
Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
