Good day internet forum browsers!
I have a dilemma here, quiet embarrassing since I've been programming in c/c++ for a good couple of years now. I just started up again and I decided to goof around and make a text base game, and I'm making a class for it since its an interesting concept and I might just turn it into a windows program later on.
k here's the problem - I declare a string, a simple task, or so I thought, but I've been plagued with this error
31 C:\Dev-Cpp\game.h `string' does not name a type
Past experiences I haven't ever had to give a string a type, but I tried to appease the compiler to no avail. Any help in the right direction here would be awesome.
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
|
#include <iostream>
#include <string.h>
#ifndef GAME_H
#define GAME_H
/*
* No description
*/
class Game
{
public:
// class constructor
Game();
// class destructor
~Game();
private:
string names;
double EXP;
int LEVEL;
};
#endif // GAME_H
|
Also having this error in the implementation file
3 C:\Dev-Cpp\game.cpp In file included from game.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include "game.h" // class's header file
// class constructor
Game::Game()
{
// insert your code here
}
// class destructor
Game::~Game()
{
// insert your code here
}
|
Most of this is Pseudo code, but it should all compile with no problem.