Hey guys,
I come over from C, wanting to learn C++. I have a nice little book but figured I could use a project to get me going.
So I magicly crafted code, and ran into this problem: C:\Code\Rapture\World.h|7|error: ISO C++ forbids declaration of `Breeture' with no type|
With this code:
Breeture.h:
#ifndef BREETUREH
#define BREETUREH
#include <vector>
#include "World.h"
class Breeture{
friend class World;
public:
//Creates the breeture
Breeture();
//Pwns the breeture.
void Die();
~Breeture();
void Age();
void outputDNA();
void outputAge();
void outputData();
private:
bool alive;
unsigned int number;
unsigned int age;
unsigned int DNA[2];
unsigned int causeofdeath;
unsigned int kids;
unsigned int deathChance;
vector<*Breeture> parents;
vector<*Breeture> children;
vector<*Breeture> partners;
};
#endif
World.h:
#ifndef WORLDH
#define WORLDH
#include <vector>
#include "Breeture.h"
class World{
public:
void NewBreeture(const Breeture *const baby);
void BaiBreeture(const Breeture *const deceased);
/*This function ages all living breetures*/
void AgeBreetures();
/*Does a death-check. World makes Breetures die.*/
void DeathCheck();
/*World also makes breetures mate.*/
void BirthCheck();
//int StoreFamilyTree(string *location);
private:
unsigned int worldPopulation;
unsigned int totalBreetures;
/* And...
The oldest breeture
The breeture with the most direct-offspring*/
Breeture oldest;
Breeture mostChildren;
/*Holds a vector of living creatures, for speedy aging*/
vector<*Breeture> livingBreetures;
/*Holds a tree of vector describing parent/child relationships*/
vector<*Breeture> familyTree;
*/
};
#endif
Why doesn't World.h know about the breeture class?
Thanks in advance,
Nick