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 2 of 3.
Rahul said:
1 decade ago
Why we can not use private to the class?
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.
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.
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.
Yogendra said:
1 decade ago
What is different in class and classic function?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers