Translations:Demystifying C++ - Classes/2/en
Jump to navigation
Jump to search
Methods
Just as the C++ compiler does, the transpiler translates classes into C structures and functions. The methods of the class are turned into functions that take a "this" pointer to the structure representing the class. When accessing attributes, the this-pointer is used automatically, and when calling other methods, it is simply passed on.