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
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 |
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 |
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 |
What is constructor in oop?
Can we have a private constructor ?
12 Answers HSBC, Ness Technologies, TCS, Wipro,
where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?
how to write a java program for an output ****0 ***01 **012 *0123 01234
What is extreme programming?
Difference between new operator and operator new
What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass
WHAT'S THE OOPS BASIC OOPS CONCEPTS IN DOTNET
What is Agile methodology?
20 Answers ABC, Accenture, College School Exams Tests, Inmar, Microsoft, Sapient,
What is encapsulation and abstraction? How are they implemented in C++?
0 Answers Agilent, ZS Associates,
what is function over loading?
what is diff between .net 1.1 and .net 2.0