
Week 06 - Pointers
Quiz
•
Computers
•
University
•
Practice Problem
•
Easy
Hai Minh Nguyen
Used 1+ times
FREE Resource
Enhance your content in a minute
21 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a pointer in C++?
A pointer is a special kind of loop in C++.
A pointer is a variable that stores a string in C++.
A pointer is a type of function in C++.
A pointer is a variable that holds the address of another variable in C++.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a pointer variable?
int *ptr;
ptr: int;
pointer int ptr;
int ptr;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is pointer arithmetic?
Pointer arithmetic is the process of converting pointers to integers.
Pointer arithmetic is the process of performing arithmetic operations on pointers to navigate through memory addresses.
Pointer arithmetic is the method of allocating memory for variables.
Pointer arithmetic refers to the use of pointers in function calls.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of dynamic memory allocation?
To create fixed-size arrays that cannot be resized.
The purpose of dynamic memory allocation is to allocate memory at runtime, allowing for flexible and efficient memory management.
To reduce the overall memory usage of a program.
To allocate memory only at compile time.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you allocate memory dynamically in C++?
Use 'calloc' for allocation and 'realloc' for deallocation.
Allocate memory using 'alloca' and 'dealloca'.
Use 'new' for allocation and 'delete' for deallocation.
Use 'malloc' for allocation and 'free' for deallocation.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you check if a pointer is null?
Check 'if (ptr != NULL)'
Use 'if (ptr = NULL)'
Use 'if (ptr == NULL)' or 'if (ptr == nullptr)'.
Use 'if (ptr != 0)'
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you deallocate memory in C++?
Use 'dispose' for both single objects and arrays.
Use 'free' to deallocate memory in C++.
Use 'malloc' to allocate memory only.
Use 'delete' for single objects and 'delete[]' for arrays.
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
18 questions
Lenguaje de Definición de Datos
Quiz
•
University
20 questions
Redes Sociales
Quiz
•
University
20 questions
Examen Final Enfermeria
Quiz
•
University
20 questions
Nuevas tecnologías
Quiz
•
6th Grade - Professio...
20 questions
Information Management - QUIZ
Quiz
•
University
20 questions
Parcial1 Informatica y Redes
Quiz
•
University
18 questions
AI 900 - pt 1
Quiz
•
University
20 questions
DIAGRAMAS UML DE CLASE
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
