C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 6)
6.
Which of the following term is used for a function defined inside a class?
Discussion:
22 comments Page 1 of 3.
Hani said:
1 decade ago
The class variables are called data members
and the functions which are declared in the class is called member functions
and the functions which are declared in the class is called member functions
RIYAJ KHAN said:
1 decade ago
When member function is defined inside the class it is called as inline function.
Member function can also defined outside the class using class label. At this time it is not inline function.
Member function can also defined outside the class using class label. At this time it is not inline function.
Yogendra said:
1 decade ago
What is different in class and classic function?
Md azhar hussain said:
1 decade ago
The function defined in a particular class is called as a member of a class (or) member function and the variables defined in a particular class is member variables.
Sri said:
1 decade ago
Actuvally instance variable are used in inside the class here we are talking about function so every member function will be declared in inside the class.
Rohit said:
1 decade ago
Member variable are declared inside the class body. And member function are declared with in a class.
Prashant Kolhar said:
1 decade ago
A member function can be defined inside or outside of a class. if defined inside it becomes inline. for function defined outside it uses scope resolution operator :: and it's class name.
Snehal said:
1 decade ago
The class variable called data members. Function which are declared in the class called member function.
Manasawasthi said:
1 decade ago
Because definition of class is:
Class is a collection of data members as well as member function so the term is used member function.
Class is a collection of data members as well as member function so the term is used member function.
Oshan said:
1 decade ago
In C language-structures have different data types.
Similarly in c++ language-we have class.
Class is mainly contains two parts:
1. Data members(attributes)
(these are private to the class by default).
2. Member functions(behaviour)
Member functions can also be defined outside the class using scope resolution(::).
Syntax:
return type <class name> :: function name()
While talking about inline function then it is function defined within class itself and should contain less number of lines in its definition or it can be said as function code.
Similarly in c++ language-we have class.
Class is mainly contains two parts:
1. Data members(attributes)
(these are private to the class by default).
2. Member functions(behaviour)
Member functions can also be defined outside the class using scope resolution(::).
Syntax:
return type <class name> :: function name()
While talking about inline function then it is function defined within class itself and should contain less number of lines in its definition or it can be said as function code.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers