Home
Explore
Exams
Search for anything
Search for anything
Login
Get started
Home
[CP 2] M5 - Pointers and Dynamic Arrays
Studied by 1 person
0.0
(0)
Add a rating
Learn
A personalized and smart learning plan
Practice Test
Take a test on your terms and definitions
Spaced Repetition
Scientifically backed study method
Matching Game
How quick can you match all your cards?
Flashcards
Study terms and definitions
1 / 66
Earn XP
Description and Tags
University/Undergrad
Add tags
67 Terms
View all (67)
Star these 67
1
int *p;
What is the declaration for the pointer that points to a variable of type int?
New cards
2
20
What is the output of the following?
\#include
New cards
3
*
A symbol used to access the value of an address
New cards
4
&
A symbol used to determine the address of a variable
New cards
5
p now points to b
What will happen in this code?
int a \= 100, b \= 200;
int *p \= &a, *q \= &b;
p \= q;
New cards
6
&
Which of the following is a reference operator?
&
*
@
&
New cards
7
string mystring *;
Which of the following is NOT a way to declare a pointer variable?
New cards
8
All of the given
To create a dynamic array, you have to use:
"Pointer Variable
All of the given
Array
New operator"
New cards
9
It depends on user input
How many number 5 will display based on the given program?
\#include
New cards
10
Memory space is allocated at runtime
Which of the following is NOT true about static arrays?
New cards
11
Error
What is the output of the program?
\#include
New cards
12
143
What is the output of the given program?
\#include
New cards
13
A memory address
What is the output of the program?
\#include
New cards
14
1 2 3 4 5
What is the output of the following?
\#include
New cards
15
Pointer
It stores the memory address as its value.
New cards
16
90
What is the output of the following?
\#include
New cards
17
100 200 300 400 500
What is the output of the following program?
\#include
New cards
18
int *ip;
Which of the following is illegal?
string s, *sp \= 0;
int *pi \= 0;
int *ip;
int i; double * dp \= &i;
New cards
19
Pizza Pizza
What is the output of the following program?
\#include
New cards
20
var1
Complete the given code:
\#include
New cards
21
void pointer
It is a pointer not associated with any data types
New cards
22
new operator
Denotes a request for memory allocation on the Free Store
New cards
23
float a [10];
How a static array is declared?
New cards
24
Heap
Dynamically allocated memory is allocated on \___________________
New cards
25
error
What is the output of the given program?
\#include
New cards
26
8
What is the output of the following?
\#include
New cards
27
memory space is allocated during compile time
Which of the following is NOT true about dynamic arrays?
Group of answer choices
Memory space is allocated during compile time
Memory space is allocated at runtime
Located in Heap memory space
Dynamic size
New cards
28
by applying the dereference operator
What is used for accessing the contents of memory location whose address is stored in a pointer variable?
New cards
29
143
What is the output of the given program?
\#include
New cards
30
90
What is the output of the following?
\#include
New cards
31
x is a pointer to a string, y is a string
Choose the right option:
string* x, y;
Group of answer choices
x is y
x is a pointer to a string, y is a string
this statement produces an error
both x and y are pointer to string types
New cards
32
dynamic array declaration
double * p \= new double [45]; is an example of:
New cards
33
100 200 300 400 500
What is the output of the following program?
\#include
New cards
34
ALL OF THE MENTIONED
A void pointer can point to which type of objects?
int
float
double
all of the mentioned
New cards
35
fg daw
What is the output of this program?
\#include < iostream \>
using namespace std;
int main()
{
char *ptr;
char Str[] \= "abcdefg";
ptr \= Str;
ptr +\= 5;
cout << ptr;
return 0;
}
New cards
36
45241
\#include
New cards
37
Pizza Pizza
What is the output of the following program?
\#include
New cards
38
40
What is the output of the following?
\#include
New cards
39
20
What is the output of the following?
\#include
New cards
40
delete operator
What operator is used to free allocated memory?
New cards
41
40461
What is the output of the following program?
\#include
New cards
42
it depends on user input
How many number 5 will display based on the given program?
\#include
New cards
43
100 200 300 400 500
What is the output of the following program?
\#include
New cards
44
error
What is the output of the program?
\#include
New cards
45
8
What is the output of the following?
\#include
New cards
46
1 2 3 4 5
What is the output of the following?
\#include
New cards
47
error
What is the output of the given program?
\#include
New cards
48
a memory address
What is the output of the program?
\#include
New cards
49
Pizza Pizza
What is the output of the following program?
\#include
New cards
50
None of the mentioned
"By its definition a void pointer does not point to data of a specific type. Therefore you cannot de-reference a void pointer
when it cast to another type of object yung tamang sagot"
When does the void pointer can be dereferenced?
New cards
51
Pizza
What is the output of the following code?
\#include
New cards
52
Pizza Pizza
What is the output of the following program?
\#include
New cards
53
Pizza
What is the output of the following code?
\#include
New cards
54
20
What is the output of the following?
\#include
New cards
55
new and delete
what functions are used in dynamic memory allocation in C++?
New cards
56
45241
What is the output of the following?
\#include
New cards
57
40461
What is the output of the following program?
\#include
New cards
58
90
What is the output of the following?
\#include
New cards
59
100 200 300 400 500
\#include
New cards
60
It depends on user input
How many number 5 will display based on the given program?
\#include
New cards
61
143
\#include
New cards
62
delete
to free the dynamically allocated array pointed by pointer-variable, use:
New cards
63
new
it is used to declare memory blocks at run time (dynamically)
New cards
64
dangling pointer
a pointer that no longer points to something valid on the heap
New cards
65
delete ptr;
what is the correct syntax for deleting a pointer named ptr:
New cards
66
new operator
It requests for the memory allocation in heap
New cards
67
call the pointer
the method of passing arguments to a function copies the address of an argument into the formal parameer
New cards
Explore top notes
Anatomy
Note
Studied by 310 people
359 days ago
5.0
(3)
Preview
🏘️
House + Home
Note
Studied by 6 people
476 days ago
5.0
(1)
Preview
How to get a Perfect Score on AP Euro DBQ
Note
Studied by 11 people
83 days ago
5.0
(1)
Preview
Administración - 3. Admin global, comparada y de calidad
Note
Studied by 64 people
38 days ago
5.0
(1)
Preview
Macbeth
Note
Studied by 89 people
993 days ago
5.0
(1)
Preview
😏
Chapter 13: Question Marks
Note
Studied by 88 people
620 days ago
5.0
(1)
Preview
Anirudh Mohanty - Honors Meiosis Notes
Note
Studied by 16 people
376 days ago
5.0
(1)
Preview
Spaced Repetition Research + Knowt Algo Planning
Note
Studied by 100 people
769 days ago
4.0
(1)
Preview
Explore top flashcards
Unit II - Congress
Flashcard (34)
Studied by 5 people
298 days ago
5.0
(1)
Preview
EXAM VI (QUIZ REVIEW)
Flashcard (30)
Studied by 4 people
656 days ago
4.5
(2)
Preview
Unit 1 AP Psych
Flashcard (220)
Studied by 2 people
103 days ago
5.0
(1)
Preview
Chem 11 Chapter 1
Flashcard (93)
Studied by 8 people
39 days ago
5.0
(1)
Preview
Woordenschat - Griekse en Latijnse woorden, woorddelen en uitdrukkingen
Flashcard (56)
Studied by 6 people
754 days ago
5.0
(1)
Preview
spanish
Flashcard (137)
Studied by 14 people
170 days ago
5.0
(1)
Preview
BIO 514 Unit 1 Content
Flashcard (254)
Studied by 51 people
168 days ago
5.0
(1)
Preview
Element 2 - Behaviourist approach
Flashcard (26)
Studied by 15 people
747 days ago
5.0
(1)
Preview