S
SpreadTooThin
If this is the definition of a class:
class outbuf : public std::streambuf
{
protected:
virtual int_type overflow (int_type c) {
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(c,getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
};
How do I split this into a .h and .cpp file?
[oubuf.h]
class outbuf : public std::streambuf
{
protected:
virtual int_type overflow (int_type c);
};
[outbuf.cpp]
virtual int_type outbuff:
verflow (int_type c) {
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(c,getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
Seems the compiler doesn't like this because the of the virtual key
word...
class outbuf : public std::streambuf
{
protected:
virtual int_type overflow (int_type c) {
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(c,getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
};
How do I split this into a .h and .cpp file?
[oubuf.h]
class outbuf : public std::streambuf
{
protected:
virtual int_type overflow (int_type c);
};
[outbuf.cpp]
virtual int_type outbuff:
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(c,getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
Seems the compiler doesn't like this because the of the virtual key
word...