Static member function - C++ basic concepts

Q.  Which of the following are true about static member function?

1. They can access non-static data members.
2. They can call only other static member functions.
3. They can access global functions and data.
4. They can have this pointer.
5. They cannot be declared as const or volatile.

- Published on 17 Jul 15

a. Only 2
b. Only 2,5
c. Only 2,3,4,5
d. Only 2 , 3 , 5
e. All of these

ANSWER: Only 2 , 3 , 5
 

    Discussion

  • Brijesh   -Posted on 08 Oct 15
    Properties of static member function in c++ are as follows.

    • They can call only other static member functions.
    • They can access global functions and data.
    • They cannot be declared as const or volatile.
    • A static member function cannot be virtual.
    • static member functions do not have this pointer.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)