Which among the following can be a concept against encapsulation rules?

Which among the following can be a concept against encapsulation rules?
A. Using function pointers
B. Using char* string pointer to be passed to non-member function
C. Using object array
D. Using any kind of pointer/array address in passing to another function
 
Answer: d
Explanation: If we use any kind of array or pointer as data member which should not be changed, but in some case its address is passed to some other function or similar variable. There are chances to modify its whole data easily. Hence Against encapsulation.
 

Tìm kiếm

Back
Top