Next: When do I use
Up: class and struct
Previous: class and struct
class) is almost like a struct in C
(i.e. a set of attributes), but has two additional kinds of members:
methods and data types. A class' method has to be used
with an instance of that class. The important is that methods have
always access to their instance's attributes and data types.
typedef char t_byte; // type
unsigned char i; // attribute
void m() // method
t_byte b = 1; // m can access type t_byte
i = b; // m can access attribute i
a.m(); // an instance is required to call a method.
Alexis Angelidis (PhD)