Firstly I am a beginner, but very enthusiastic about coding.
I have this base class from which several classes are inherited. A function is written in base class which requires the size of the called object. At the time of coding of the function, the size is unknown as the function may be called by objects of different derived classes. Until now, I have been passing the size as an argument, but the should be some way around.
I tried sizeof(*this), but sizeof(*this) returns an entirely different value which is neither the size of the base class nor the size of the derived class. I am confused.... Any Explanations?