State whether True or False? (i) Pointer arithmetic can't be done on a void…
2018
State whether True or False?
(i) Pointer arithmetic can't be done on a void pointer.
(ii) A void pointer cannot point to a class member in C++.
- A.
(i) – True, (ii) – True
- B.
(i) – True, (ii) – False
- C.
(i) – False, (ii) – True
- D.
(i) – False, (ii) – False
Attempted by 99 students.
Show answer & explanation
Correct answer: A
Statement (i) is True because C++ forbids arithmetic on void pointers due to their incomplete type size. Statement (ii) is also True as a void pointer cannot store the specific representation required for C++ member pointers. Therefore, both statements are True.