So basically, the derived class only inherits things from the [php]private:[/php] part of the base class? Yet you need to declare the method in the [php]public:[/php] of the base class?
lulwut?
|:
I guess i should speak in engrish
If i do
[php]class derived : private base[/php]
it only inherits things from the [php]private:[/php] of [php]class base[/php] Yet I need to declare the name of the methods in the [php]public:[/php] of [php]class base[/php] but i need to define the methods in [php]private:[/php] of [php]class base[/php]
moar understandable?
I'm not getting this.. are you asking a question or just stating something? That looks like something you can just try by yourself with your IDE. |:
Im asking.....
Well.
Alright. Will test in ide
No, that sets the most accessible class in your base class.
So, doing:
[php]public Polygon : protected Triangle
class Triangle {
public:
int Sides;
protected:
int Colour;
private:
bool _Hidden;
}
[/php]
would transform transform the variable (int) 'Sides' to protected, and retain the rest.
use "protected:"
Originally Posted by C4P
use "protected:"
Have you even READ one line of a single post in this thread? (including the thread starter post)
Originally Posted by freedompeace
Have you even READ one line of a single post in this thread? (including the thread starter post)
no, but i read the title: "Private inheritance".
But what if i have something like this
[php]class ElectricMotor
{
why bother with it? the private and public crap is just for ur ide, when compiled theres no difference in public and private functions >.>
Originally Posted by Hell_Demon
why bother with it? the private and public crap is just for ur ide, when compiled theres no difference in public and private functions >.>
Ease-of-development, sir.
Furthermore, there is a difference, although subtle, and of little use when hacking games - host assemblies are not able to view private functions, variables and so on.
Alright. solbed
request close
Solbed is solbed mate.
I do duh code for duh game devving