C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 4)
4.
Which of the following is not the member of class?
Static function
Friend function
Const function
Virtual function
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
42 comments Page 2 of 5.

Shashi said:   1 decade ago
A friend function is that function of the class which can access the private and public members of the class but it is not the member of the class. It is declared inside the class either in private or public.

Abhishek porwal said:   1 decade ago
Private data member can acess out side the class with the help of friend function. (i.e) we can access the private data member of the base class in drived class so we use friend function.

Raj said:   1 decade ago
@Pooja.

Friend function can access the private & protected data of the parent class!

Normally, Other class couldn't able to access the private & protected data of a class.

Ashish ranjan shadangi said:   1 decade ago
pA = &oB; means pA contains the address of oB. And pA->show will definitely show the output as 2.

So what is the requirement of show as virtual function?

Abhishek chaudhary said:   10 years ago
If friend function will be the member function of the class then it can access private data member of the class without using friend function.

Vidya v nair said:   1 decade ago
Virtual function means the function defined in a base class implemented by the child class and it is called at the run time.

Chetan said:   9 years ago
A friend is a function, i.e. It's not member of the class but has access to private and protected members of the class.

Srikanth said:   1 decade ago
A const function is one, which doesn't allow any modification or change its instance variable's data (member data).

Goldy said:   4 years ago
Is it possible to modify a private data member of a class through a non-member function? If yes means How? Explain.

Thazaar said:   10 years ago
Friend function is used to access the private data member of a class. So it is not a member of a class.


Post your comments here:

Your comments will be displayed after verification.