Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

Inheritance in C++ - VERY URGENT

How do I go about having one class inherit from another class?
0
alligarbage
Asked:
alligarbage
1 Solution
 
Raynard7Commented:
I do not think that it can be explained more clearly than at
http://www.cplusplus.com/doc/tutorial/inheritance.html
0
 
alligarbageAuthor Commented:
So, all I have to do is basically after the name of the class I am trying to inherit to, I type the name of the class I'm trying to get it from, right?

Example:
Food (class I'm trying to inherit from)
Car (class I'm trying to inherit to)

class Food
{
     code here
}

class Car: public Food
{
      code here
}
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now