0

I am trying to learn C++ by practicing with exercises from the book but I seem to have run into yet another problem. I know the ostream_withassign class is found in the iostream library and that is included but I still do not understand what I am missing in my code still. I tried std but that does not seem to work either. Any one able to please inform me on what I am missing please. Thanks in Advance!

#include "stdafx.h"
#include "Conios.h"


class ConsoleStream :public ostream_withassign, public Conios
{
protected:
    char X;
    char Y;


public:
    ConsoleStream(void);
    ConsoleStream(std::streambuf * Buffer);
    void SetX(char XX);
    void SetY(char YY);
    ConsoleStream &operator =(std::ostream &Out);
    ~ConsoleStream(void);
};
Kobojunkie
  • 6,375
  • 31
  • 109
  • 164
  • 1
    `ostream_withassign` is not a class contained in the C++ standard library. Also, what is the exact error message? – Xeo Dec 24 '11 at 07:44
  • This question might be ironically timely, since assignment was disabled in C++03 but enabled (via `std::move`) in C++11. However, I wonder how an `ostream` derivative can take any `streambuf` and place its output at X,Y coordinates. This more likely requires a `streambuf` derivative, not `ostream`. – Potatoswatter Dec 24 '11 at 08:14
  • error C2504: 'ostream_withassign' : base class undefined – Kobojunkie Dec 24 '11 at 08:25

1 Answers1

2

Your book must be very old (in computing terms). The ostream_withassign class was a nonstandard type available in "iostream.h" back in Visual Studio 6.0. You should probably update your reference material and use something more modern as many, many things have changed in C++ since then (c. 1998). (The most recent updates were standardized this year, in fact.)

bobbymcr
  • 23,769
  • 3
  • 56
  • 67
  • Is there a replacement for this particular class in the revision? Or is there a way I can still take advantage of the old library? – Kobojunkie Dec 24 '11 at 08:29
  • @Kobo: The biggest advantage you can take of that old library is to replace it. No, really. – Xeo Dec 24 '11 at 08:40
  • I am not certain what it can be replaced with. I have been trying to follow the exercises in the book in order to learn C++ – Kobojunkie Dec 24 '11 at 08:46
  • 1
    I strongly suggest finding a different book that has up-to-date information. Maybe start here: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list – bobbymcr Dec 24 '11 at 17:25