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
Member function
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
A class function
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
An operator
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
A method
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B Member function

In c++ a function contained within a class is called the member function.

Amember 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 an object of the class of which it is a member, and has access to all the members of a class for that object.

Member functions and functions are names used interchangeably in reference to classes. Function prototypes are declared within the class definition. These prototypes can take the form of non-class functions as well as class suitable prototypes. Functions can be declared and defined within the class definition.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Packing Fraction and Efficiency
CHEMISTRY
Watch in App
Join BYJU'S Learning Program
CrossIcon