Which of the following is not the member of class?

By Priyanshu Vaish|Updated : June 28th, 2022

Which of the following is not the member of class?

  1. Static function
  2. Const function
  3. Friend function
  4. Virtual function

Answer: Option C. Friend function

Friend function is not the member of class.

Solution

In C, a function with a scope restricted to its object file is known as a static function. The static function is thus only accessible through its object file. By adding the static keyword before the function name, a function can be declared as static.

The function declared in the program as constants are the const member functions. These functions cannot alter the object they call. Use of the const keyword is advised to prevent unintentional changes to objects. Any kind of object can call a const member function.

The friend function is not the member of class. Despite not being actual members of the class, they are given the same access permissions as the member function.

☛ Related Questions:

Comments

write a comment

Follow us for latest updates