Also I have changed all that stuff, the code does seem easier to understand now, but the compiler still treats Inn.cpp as part of the Armour class.
Armour.h
#ifndef ARMOUR_H#define ARMOUR_H#include "libraries.h"class Armour : public Item{public: int defense; Armour() { defense = 0; ); CreateArmour(std::string newname, int newdefense, int newprice) { name = newname; defense = newdefense; cost = newprice; };};#endif
Inn.cpp
#include "libraries.h"bool OverHear = false;Player MyPlayer;int Inn(){ if (OverHear == false) { std::cout << "Lots of Text"; OverHear = true; MakePlayer(&MyPlayer); } std::cout << "More Text"; std::cout << "\n\n> "; int choice = 0; getchar(); std::getchar(); return 0;}
And the errors are still:
3 C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Inn.cpp
ISO C++ forbids initialization of member `OverHear'
3 C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Inn.cpp
making `OverHear' static
3 C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Inn.cpp
ISO C++ forbids in-class initialization of non-const static member `
7 C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Inn.cpp
`int Armour::Inn()' and `int Armour::Inn()' cannot be overloaded
24 C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Inn.cpp
parse error at end of input
C:\Documents and Settings\Owner\My Documents\Programming\C++\To Be A Legend\Makefile.win
[Build Error] [Inn.o] Error 1
Whether you think you can or think you can’t, you’re probably right – Henry Ford