R
Ranjay
Hi Everyone,
I have this following class
class xx{
public:
int func(){}
};
I have a main as follows
int main(){
xx x1,x2;
x1.func();
x2.func();
}
My questions ?
============
How does the c++ compiler organise the functions inside a class ?.
Are they stored as function pointers something like this
int (xx::func) () something the user cannot figure out and to him/her
it appears as object.member_function() e.g x1.func()
While we were discussing all this some one told me that x1.func()
actually resolves to x1.func(*this)
Still another guy was of the opinion that x1.func() resolves to
x.func(&x1).
All this provides different thoughts and different interpretations
Please provide some clarity on how the compiler would actually organise
it
My thanks in advance
Thanks
Ranjaya
I have this following class
class xx{
public:
int func(){}
};
I have a main as follows
int main(){
xx x1,x2;
x1.func();
x2.func();
}
My questions ?
============
How does the c++ compiler organise the functions inside a class ?.
Are they stored as function pointers something like this
int (xx::func) () something the user cannot figure out and to him/her
it appears as object.member_function() e.g x1.func()
While we were discussing all this some one told me that x1.func()
actually resolves to x1.func(*this)
Still another guy was of the opinion that x1.func() resolves to
x.func(&x1).
All this provides different thoughts and different interpretations
Please provide some clarity on how the compiler would actually organise
it
My thanks in advance
Thanks
Ranjaya