When I create a class , lets say Person which includes:
Id and name.
ctor, copy ctor, three member functions.
What does the compiler do everytime I create an instance of person? what happens behind the scenes?
I know that it calls the ctor first to create the object, but how does it "connect" the object with the member functions? does it create separate member functions for each object created..? I guess not. what does it do then?
It's pretty easy: When a member function is called the first invisible parameter is the pointer to the surrounding object. The name of the paramater is this. member variables are accessed (again invisibly) via the this pointer