Which is correct syntax to access the static member functions with class name?
a.className . functionName;
b.className -> functionName;
c.className : functionName;
d. className :: functionName;
Answers
Answered by
0
Answer:
--- Option (D)
Explanation:
--- The scope resolution operator must be used to access the static member functions with class name. This indicates that the function belongs to the corresponding class.
------------------------------------------
HOPE IT HELPS
Answered by
0
Option(d) className:: functionName; is the right one.
- When the programmer defines the function with a special keyword static then the function became a static function.
- Unlike other functions, the access right for the static function is restricted.
- So the function declares static when the access is wanted restricted.
- When the static function is need to be called the scope resolution function is used.
- Therefore, the scope resolution operator '::' is used for access purposes.
Similar questions