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?
Member Variable
Member function
Class function
Classic function
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 2 of 3.

Shaikh Moin Rukmoddin said:   1 decade ago
The class variables are called data members and the functions which are declared in the class is called member functions.

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.

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

Anky said:   1 decade ago
Difference b/w class functions and member functions?

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.

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.

Snehal said:   1 decade ago
The class variable called data members. Function which are declared in the class called member function.

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.

Rohit said:   1 decade ago
Member variable are declared inside the class body. And member function are declared with in a class.

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.

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.


Post your comments here:

Your comments will be displayed after verification.