I'm having trouble with this piece of code , after i took this class from the main.cpp file and splitted it in to .h and .cpp the compiler started complaining about the default parameters i was using in a void.
/* PBASE.H */
class pBase : public sf::Thread {
private:
bool Running;
public:
sf::Mutex Mutex;
WORD OriginalColor;
pBase(){
Launch();
Running = true;
OriginalColor = 0x7;
}
void progressBar(int , int);
bool key_pressed();
void setColor( int );
void setTitle( LPCWSTR );
bool test_connection(){
if(Running == false){
return 0;
}
else{
return 1;
}
return 0;
}
void Stop(){
Running = false;
if(Running == false) Wait();
}
};
/* PBASE.CPP */
// ... other stuff above
void pBase::setColor( int _color = -1){
if(_color == -1){
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ),FOREGROUND_INTENSITY | OriginalColor);
return;
}
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ),FOREGROUND_INTENSITY | _color);
}
And the error , taken from VC2010
Error 4 error C2572: 'pBase::setColor' : redefinition of default parameter : parameter 1