Translations:Demystifying C++ - Classes/2/en

From emmtrix Wiki
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.