Which is the parameter that is added to every non-static
member function when it is called?

Answers were Sorted based on User's Feedback



Which is the parameter that is added to every non-static member function when it is called?..

Answer / manish kumar

(this) pointer is added.
this pointer contains the address of the object through
which function is called.
this->data member will give the data of the object.

Is This Answer Correct ?    49 Yes 4 No

Which is the parameter that is added to every non-static member function when it is called?..

Answer / arun

"this" (i.e. Pointer to the object which call the member
function) is passed as the argument when a member function
is called.

Is This Answer Correct ?    21 Yes 1 No

Which is the parameter that is added to every non-static member function when it is called?..

Answer / manjunath

Ex:

class Employee{
public:
int member_Function1(){}
void display()
{
do something;
}
};
int main()
{
Employee e1;
e1.member_Functiuon(int a, int b);------> refer below
1...
}

1...

Here e1 is an object of Employee Class.
Now e1.member_Function(int a, int b) means
implicitly the this pointer is applied to the
function as

member_Function(Employee *const this, int a, int b).

Here the implicit this is a constant pointer to the
object's address of type Employee. Once the Object has been
created the address is given to it(e1). the address is
passed as the first argument becoz the function resolving
is faster...

Is This Answer Correct ?    12 Yes 1 No

Post New Answer

More OOPS Interview Questions

Why do we use virtual functions?

4 Answers  


Get me an image implementation program.

0 Answers  


What are the three parts of a simple empty class?

0 Answers  


How to hide the base class functionality in Inheritance?

0 Answers   Viscus Infotech,


What is the difference between Home and $Home?

2 Answers   TCS,






Advantage and disadvantage of routing in telecom sector

0 Answers  


What is an example of genetic polymorphism?

0 Answers  


What is the main difference between C++ and Java

11 Answers   TCS,


what are the different types of qualifier in java?

0 Answers   TCS,


can you explain how to use JavaBean in Project

3 Answers   Infosys, Satyam,


what is the abstract class,interface ,its difference with a programatic eg.? hi,recently i went for an interview they ask me what is abstract class ,interface and its difference I said abstract class contain abstact method ,abstract method is a method with no body.Abstract class cannot be instantiated.Abstract class is a base class it required derived class for the implementation of method. Interface is a syntactical contract that all derived class should follow it define properties ,method,events which are known as member of interface. Then They asked me what is the difference between them. I said abstract class interface 1.abstact class can implement method 1.interface cant 2.abstact class can contain constructor, 2.interface cant destructor 3.abstract class cannot support multiple 3.interface support inheritance etc Then they said some different answer I said dont no. Then they ask me when i should make abstract class for an project and when i should make interface. I said if suppose there is two class which must be having method with different logic then we sholud make abstract class. and if suppose we have two class having method .with different logic then we can make interface . Am i correct with my explaination.if not correct me .please provide me that when should we create abstract class and interface and what is difference .please help me

1 Answers  


What are the four main oops concepts?

1 Answers  


Categories