cout not a member of std

My cout isn't working. I have upstream so what's up?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  #include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>

using namespace 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();
       }
       else if(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 using namespace std;, however, and while I wouldn't recommend doing that in the first place, it makes the std:: qualifier redundant.
Topic archived. No new replies allowed.