Which is the correct syntax to call a member function using pointer?

Kim Thu Đoàn

New member
Which is the correct syntax to call a member function using pointer?
A. pointer->function()
B. pointer.function()
C. pointer::function()
D. pointer:function()
 
Answer: a
Explanation: The pointer should be mentioned followed by the arrow operator. Arrow operator is applicable only with the pointers. Then the function name should be mentioned that is to be called.
 

Tìm kiếm

Back
Top