class question
If I have for example
Animal.h
1 2 3 4 5
|
#ifndef ANIMAL_H
#define ANIMAL_H
class Animal
{};
#endif
|
Bird.h
1 2 3 4 5 6 7 8 9 10 11 12
|
#ifndef BIRD_H
#define BIRD_H
#include "Animal.h"
class Bird : public Animal
{
private:
public:
Bird();
~Bird();
};
#endif
{}
|
how do get the bird object ?
something like this
Bird bird;
right ?
Also do i need
#include "Bird.h"
in the main function if i already have
#include "Animal.h"
?
Last edited on
Yes, you can create a bord object that way...
you don't need the Animal.h , Bird.h is enough...
Topic archived. No new replies allowed.