#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
usingnamespace std;
string x;
int herolvl = 1;
int herohp = herolvl + 19;
int herostr = herolvl + 4;
int creaturehp = (herolvl + 4);
int creaturestr = (herolvl + 4);
class game{
public:
void start(){
}
};
class save{
public:
void dev(){
ofstream a_file("Gamesave.dat");
a_file<<"hero level "<<herolvl <<endl;
a_file<<"hero healthpoints "<<herohp <<endl;
a_file<<"hero strength "<<herostr <<endl;
a_file.close();
}
};
class attack{
public:
void match(){
while(creaturehp > -1){
cout<<"Creatures Health points! "<<creaturehp<< endl;
cout<<"Heros Health points! "<<herohp<< endl;
creaturehp = creaturehp - herostr;
herohp = herohp - creaturestr;
}
}
};
class encounter{
public:
void battle(){
cout<<"You have encountered a creature, attack or run.";
cin>>x;
if(x == "attack"){
attack bev;
bev.match();
}
elseif(x == "run"){
}
}
};
int main(){
std::Cout<<"Type help for instructions on saving and playing the game. If you already know how to play just hit a key.";
cin>>x;
cin.ignore();
if(x = "ok"){
cout<<"type save to save game.";
game start_;
start_.start();
}
else{
game start_;
start_.start();
}
}
On line 57? cout does not have a capital C, and identifiers are case-sensitive. You are usingnamespace std;, however, and while I wouldn't recommend doing that in the first place, it makes the std:: qualifier redundant.