Hi,
I want to create a class with its definition in cls.h and
implementation in cls.cpp I get errors about redfinitions and errors
wahtever way I try to initialise the static proivate variable
*log_file.
// cls.h:
class logger
{
public:
void create(char *log_file_name) ;
};
// cls.cpp
class logger
{
public:
void create(char *log_file_name)
{
srtcpy *log_file_name, *log_file);
}
private:
static char *log_file;
};
What is the right way to split this so that compiler knows what I am
trying to do?
I want to create a class with its definition in cls.h and
implementation in cls.cpp I get errors about redfinitions and errors
wahtever way I try to initialise the static proivate variable
*log_file.
// cls.h:
class logger
{
public:
void create(char *log_file_name) ;
};
// cls.cpp
class logger
{
public:
void create(char *log_file_name)
{
srtcpy *log_file_name, *log_file);
}
private:
static char *log_file;
};
What is the right way to split this so that compiler knows what I am
trying to do?
Comment