• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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