Update class member before access in C++

45 Views Asked by At

I'd like to ask if by only using operator overloading is there a way to update a class member before accessing it. For example, I've got this class

class DictionaryWord
{
    string      Word;
    unsigned    Size;
    unsigned    Score;
};

and I want whenever I do objDictionaryWord->Size to get Word.size()

P.S. Also, I'm just starting to learn C++, if you know of some excelent tutorials for beginners that explain operator overloading please share them.

0

There are 0 best solutions below