I keep getting this error message about intializing a varible as a string type:
`string' does not name a type
I cant figure out how to get rid of it even though i have #include<string>
any help would be great:
#include <string>
#include <fstream>
int MAX_ITEMS = 5;
enum RelationType {LESS, GREATER, EQUAL};
class ItemType
{
public:
ItemType();
RelationType ComparedTo();
void PromoteMe();
void DemoteMe();
private:
string company;
string name;
int rank;
int total;
};
ItemType :: ItemType(string myName,string myCompany)
{
name = myName;
company = myCompany;
rank = 1;
total = 0;
}
RelationType ItemType::ComparedTo(ItemType otherObj)
{
if((company < otherObj.company)||(company == otherObj.company)
&&(rank < otherObj.rank))
return LESS;
else if((company > otherObj.company)||(company == otherObj.company)
&& (rank > otherObj.rank))
return GREATER;
else
return EQUAL;
}
void ItemType::PromoteMe()
{
rank = rank + 1;
}
void ItemType::DemoteMe()
{
rank = rank-1;
}