How do you differentiate between a member function and normal function?

1 answer

Answer

1048164

2026-08-04 21:40

+ Follow

A normal function is any function that is not a member of any class. Normal functions that operate upon a class are referred to as non-member functions, however a non-member function can also be a member of another class. Any class may declare any non-member function to be a friend of the class, in which case the function becomes a friend function.

A member function is a member of a class and may be declared static or non-static. Non-static member functions have the following 3 properties:

  1. Private access to the class members.
  2. Scoped to the class.
  3. Must be invoked against an object of the class (has a 'this' pointer).

Static member functions have the first two properties only while friend functions have the first property only. Non-member functions that are not friends of the class have none of these properties.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.