Inheritance

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
codinitup
Posts: 112
Joined: June 27th, 2012, 7:43 am

Inheritance

Post by codinitup » July 2nd, 2012, 8:44 am

Hey chili, I have learned c++ previously, but I've used your videos as a good way too review my skills, I also noticed something that I thought was interesting... When we say the following...

Code: Select all

void Game::Function()
{
    Code
}
aren't we using inheritance? I say that because it looks to me like game.cpp is inheriting the game.h file
in this case.
MOOOOOO

User avatar
npissoawsome
Posts: 114
Joined: June 8th, 2012, 3:01 pm

Re: Inheritance

Post by npissoawsome » July 2nd, 2012, 9:12 am

codinitup wrote:Hey chili, I have learned c++ previously, but I've used your videos as a good way too review my skills, I also noticed something that I thought was interesting... When we say the following...

Code: Select all

void Game::Function()
{
    Code
}
aren't we using inheritance? I say that because it looks to me like game.cpp is inheriting the game.h file
in this case.
ahah, nope, not quite ;)

It's not really inheriting anything, it's just showing it's a class member

User avatar
codinitup
Posts: 112
Joined: June 27th, 2012, 7:43 am

Re: Inheritance

Post by codinitup » July 2nd, 2012, 9:20 am

Oh, I'm getting my stuff confused :? lol. Thanks for the heads up about that though, it was intriguing me for a while!
MOOOOOO

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Inheritance

Post by chili » July 2nd, 2012, 1:28 pm

Yup, no inheritance in the framework brah. The .h file basically just sketches out the class, and the .cpp file gives the actual content of the member functions. The Game:: part is just to specify that we are talking about a function in the Game class.
Chili

Post Reply