More C++ Help Please! Header file not functioning correctly!
I know that this is technically not the correct way to use header files, but all I want is for my code to work and compile correctly. I always appreciate the help. I get the error that the Allele objects are not defined as type. #ifndef STRUCTURE_H #define STRUCTURE_H #include <iostream> using namespace std; class Allele{ public: string phenotype; bool isDominant; }; class Genotype { public: bool isDominant; void makeGenotype(const Allele& firstAllele, const Allele& secondAllele) { if (firstAllele.isDominant) { isDominant = true; cout << "The animal is, " + firstAllele.phenotype; } if (secondAllele.isDominant) { isDominant = true; cout << "The animal is, " + secondAllele.phenotype; } } }; Allele HairyDominant; Allele HairyRecessive; Allele GiantHeadDominant; Allele GiantHeadRecessive; Allele EyeColorOrangeDominant; Allele EyeColorOrangeRecessive; HairyDominant.phenotype="Hairy"; HairyDominant.isDominant= true; HairyRecessive.phenotype=" Not Hairy"; HairyRecessive.isDominant= false; GiantHeadDominant.phenotype="Giant Head"; GiantHeadDominant.isDominant= true; GiantHeadRecessive.phenotype= "Not Giant Headed"; GiantHeadRecessive.isDominant= false; EyeColorOrangeDominant.phenotype= "Not Orange Eyed"; EyeColorOrangeDominant.isDominant=true; EyeColorOrangeRecessive.phenotype= "Orange Eye"; EyeColorOrangeRecessive.isDemoninat=false; Genotype Hairy; Genotype GiantHead; Genotype OrangeEyes; #endif