hello list,
I am trying to overload the operators << and >> to save and read a
class I am coding, called Preenchimento, but I am having some problems.
When I try to compile the file, I get these errors:
in file included from preenchimento.cpp:15:
preenchimento.h:33: error: expected constructor, destructor, or type
conversion before '&' token
preenchimento.h:33: error: expected `,' or `;' before '&' token
preenchimento.h:34: error: expected constructor, destructor, or type
conversion before '&' token
preenchimento.h:34: error: expected `,' or `;' before '&' token
preenchimento.cpp:61: error: expected constructor, destructor, or type
conversion before '&' token
preenchimento.cpp:61: error: expected `,' or `;' before '&' token
preenchimento.cpp:71: error: expected constructor, destructor, or type
conversion before '&' token
preenchimento.cpp:71: error: expected `,' or `;' before '&' token
the code from preenchimento.h
class Preenchimento
{
public:
unsigned char red, green, blue;
unsigned int alpha;
public:
Preenchimento();
Preenchimento(unsigned int r, unsigned int g, unsigned int
b, unsigned int a);
~Preenchimento();
int CriaPreenchimento(unsigned int r, unsigned int g,
unsigned int b, unsigned int a);
void ativa();
const Preenchimento& operator=(const Preenchimento&);
};
istream& operator >>(istream&, Preenchimento&);
ostream& operator <<(ostream&, const Preenchimento&);
the header of preenchimento.cpp
#include <windows.h>
#include <gl/gl.h>
#include <iostream>
#include "preenchimento.h"
Preenchimento::Preenchimento()
{
red = green = blue = 0;
alpha = 0;
}
thank you for your time,
andrei
--
RGB Design Digital
www.rgbdesigndigital.com.br
an...@rg... / (51) 92067436
|