int *p;
What is the declaration for the pointer that points to a variable of type int?
20
A symbol used to access the value of an address
&
A symbol used to determine the address of a variable
p now points to b
What will happen in this code?
int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
&
Which of the following is a reference operator? &
@
&
string mystring *;
Which of the following is NOT a way to declare a pointer variable?
All of the given
To create a dynamic array, you have to use:
"Pointer Variable All of the given Array New operator"
It depends on user input
Memory space is allocated at runtime
Which of the following is NOT true about static arrays?
Error
143
A memory address
1 2 3 4 5
Pointer
It stores the memory address as its value.
90
100 200 300 400 500
int *ip;
Which of the following is illegal?
string s, *sp = 0;
int *pi = 0;
int *ip;
int i; double * dp = &i;
Pizza Pizza
var1
void pointer
It is a pointer not associated with any data types
new operator
Denotes a request for memory allocation on the Free Store
float a [10];
How a static array is declared?
Heap
Dynamically allocated memory is allocated on ___________________
error
8
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
by applying the dereference operator
What is used for accessing the contents of memory location whose address is stored in a pointer variable?
143
90
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
dynamic array declaration
double * p = new double [45]; is an example of:
100 200 300 400 500
ALL OF THE MENTIONED
A void pointer can point to which type of objects?
int
float
double
all of the mentioned
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;
}
45241
Pizza Pizza
40
20
delete operator
What operator is used to free allocated memory?
40461
it depends on user input
100 200 300 400 500
error
8
1 2 3 4 5
error
a memory address
Pizza Pizza
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?
Pizza
Pizza Pizza
Pizza
20
new and delete
what functions are used in dynamic memory allocation in C++?
45241
40461
90
100 200 300 400 500
It depends on user input
143
delete
to free the dynamically allocated array pointed by pointer-variable, use:
new
it is used to declare memory blocks at run time (dynamically)
dangling pointer
a pointer that no longer points to something valid on the heap
delete ptr;
what is the correct syntax for deleting a pointer named ptr:
new operator
It requests for the memory allocation in heap
call the pointer
the method of passing arguments to a function copies the address of an argument into the formal parameer