QUESTION 1 The deference operator accesses the ___________ of a pointer variable
ID: 3915317 • Letter: Q
Question
QUESTION 1
The deference operator accesses the ___________ of a pointer variable?
value
pointer
address
binky
QUESTION 2
What will the following code output?
An asterisk followed by the address of the number variable
The address of the number variable
22
An asterisk followed by 22
QUESTION 3
An array name is a constant pointer to the first element in the array.
True
False
QUESTION 4
A function may return a pointer, but the programmer must ensure that the pointer ________.
has not previously been returned by another function
Still points to a valid object or variable after the function ends
has not been assigned an address
No other answer applies
was received as a parameter by the function
QUESTION 5
Where does the last pointer in a linked-list point to?
We don't set the last pointer value.
To NULL.
To head.
To itself.
QUESTION 6
Which operation on a linked-list is faster than doing the same operation on a vector(array).
Inserting an element at the end.
Accessing the last element.
Inserting an element at the beginning.
Accessing the middle element.
QUESTION 7
Assuming myValues is an array of int values, and index is an int variable, both of the following statements do the same thing.
True
False
QUESTION 8
Given the following struct defination:
cout << Cptr.y << endl;
cout << c->y << endl;
cout << C.y << endl;
cout << Cptr->y << endl;
QUESTION 9
Select a correct answer for the following code.
int *pValue = new int;
*pValue = 45;
pValue = new int;
*pValue =55;
cout << *pValue << endl;
45 and 55 are stored in different memory locations.
The memory space that originally stores 45 can still be accessed.
None of the above is correct.
The memory space that originally stores 45 finally stores 55.
QUESTION 10
The ________, also known as the address operator, returns the memory address of a variable.
ampersand ( & )
exclamation point ( ! )
None of these
asterisk ( * )
percent sign (%)
a.value
b.pointer
c.address
d.binky
Explanation / Answer
1) Dereference Operator accesses the value pointed by a pointer
Ex :
int x=5;
int *p;
p=&x;
cout<<*p (It prints the contents of x)
2) Answer : The address of the number variable
Print the address pointed by the var pointer (i.e,Address of number)
3) True
4) still points to a valid object after the function ends
5) To NULL
6) Inserting an element at the beginning
Explanation : In array need to shift n elements to insert an element at the beginning but in linked list it is easy to add
7) True
Explanation : array points to first element of array,+index takes to particular address of array and *(array[index]) prints element at that address
8) cout << Cptr->y << endl;
9) 45 and 55 are stored in a different memory locations
10) & (ampersand)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.