10-06-2016, 04:36 PM
If I had to explain 'RECT r' in short way, I would do it like this:
Is this an acceptable explanation? Or am I completely off?
Imagine an object: a rectangle.
A rectangle has attributes for example: 4 sides and 4 corner points!
In this code you see:
RECT r
'r' now inherits the attributes from 'RECT'. In essence we created an object 'r' which has 4 attributes.
The moment I created object 'r' of the type RECT, 'r' gained the attributes of RECT.
This means the moment you type 'r' and then immediately a dot, the attributes belonging to 'RECT' are immediately accessible.
You could also say 'r' inherited the attributes from 'RECT'.
Is this an acceptable explanation? Or am I completely off?