CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

In C++, a function contained within a class is called a.

A
In built function
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
User defined function
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Member function
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is D Member function

In C++, a function contained within a class is called a Member function.

Member functions are operators and functions that are declared as members of a class. Member functions do not include operators and functions declared with the friend specifier. These are called friends of a class. We can declare a member function as static; this is called a static member function.

A member function of a class is a function that has its definition or its prototype within the class definition like any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Animal Tissues
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon