game.hpuntero tienda a istream y ostream en una clase de C++
#ifndef GAME_H
#define GAME_H
#include <string>
#include <iostream>
#include "piece.h"
using namespace std;
class Game
{
private:
string white;
string black;
string title;
istream* in;
ostream* out;
public:
Game();
Game(istream&, ostream&);
void display(Colour, short);
};
#endif
game.cpp
#include <iostream>
#include <string>
#include <sstream>
#include "game.h"
#include "board.h"
#include "piece.h"
using namespace std;
Game::Game()
{
//nothing
}
Game::Game(istream& is, ostream& os)
{
in = is;
out = os;
}
void Game::display(Colour colour, short moves)
{
//out << "a";
}
Estoy intentando utilizar el istream y ostream en otras partes de mi clase, pero No puedo porque g ++ no me deja referencia es para. ¿Alguna idea?
También utilicé la ayuda de http://stackoverflow.com/questions/366955/obtain-a-stdostream-either-from-stdcout-or-stdofstreamfile/366969#366969 – Steven