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 is encapsulation used?

0 Answers  


What is pure oop?

0 Answers  


Can enum be null?

0 Answers  


is there any choice in opting subjects like 4 out of 7

0 Answers  


to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  






why c++ is a highlevel language

3 Answers   Satyam, Tech Mahindra,


What are classes oop?

0 Answers  


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

0 Answers  


what does exactly the linker do?

1 Answers  


What are constructors in oop?

0 Answers  


What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?

1 Answers  


polymorphism means?

6 Answers   BFL,


Categories