rvalue equivalent to the value at the pointer address.
lvalue equivalent to the value at the pointer address.
it will return nothing
none of the mentioned
Explanation:-
Answer: Option B. -> lvalue equivalent to the value at the pointer address.
Answer:(a) Explanation:In this program, We are printing the values that are pointed by pointer and also the dereference oerator. Output: $ g++ def5.cpp $ a.out 7 0xbf99fc98 8 5 14
Question 4.
What is the output of this program?
1. #include 2. using namespace std; 3. int main() 4. { 5. int x = 9; 6. int* p = &x; 7. cout
4
2
Depends on compiler
none of the mentioned
Explanation:-
Answer: Option C. -> Depends on compiler
The size of a datatype mainly depends on complier only. Output: $ g++ def3.cpp $ a.out 4
Question 5.
What is the output of this program?
1. #include 2. using namespace std; 3. int main () 4. { 5. int a; 6. int * ptr_b; 7. int ** ptr_c; 8. a = 1; 9. ptr_b = &a; 10. ptr_c = &ptr_b; 11. cout
4
2
Depends on compiler
none of the mentioned
Explanation:-
Answer: Option C. -> Depends on compiler
Answer: (a) Explanation:In this program, We are printing the values and memory address by using the pointer and derefernce operator. Output: $ g++ def2.cpp $ a.out 1 1 0xbffc9924 1
Question 6.
What is the output of this program?
1. #include 2. using namespace std; 3. int main() 4. { 5. int x; 6. int *p; 7. x = 5; 8. p = &x; 9. cout
5
10
memory address
none of the mentioned
Explanation:-
Answer: Option A. -> 5
In this program, we are copying the memory location of x into p and then printing the value in
the address. Output: $ g++ def1.cpp $ a.out 5
Question 7.
Pick out the correct option.
References automatically dereference without needing an extra character.
References automatically dereference with an extra character.
Reference will not dereference
none of the mentioned
Explanation:-
Answer: Option A. -> References automatically dereference without needing an extra character.
None.
Question 8.
What is the output of this program?
1. #include 2. using namespace std; 3. int main() 4. { 5. int a, b; 6. int* c; 7. c = &a; 8. a = 200; 9. b = 200; 10. *c = 100; 11. b = *c; 12. cout
100 200
100 0
200 200
100 100
Explanation:-
Answer: Option D. -> 100 100
In this program, We are making the assignments and invoking the both b and c values as 100