I have a global variable like this:
constchar EndByte[] = {'\x0D','\x0A'};
class Test
{
public:
Private:
}
I want to make this global array as a member variable of the class & initialise it.
How can I do this?....
Kohinoor
Printable View
I have a global variable like this:
constchar EndByte[] = {'\x0D','\x0A'};
class Test
{
public:
Private:
}
I want to make this global array as a member variable of the class & initialise it.
How can I do this?....
Kohinoor
i'm not sure that what you want but
it's is the same string for ALL instance of this class you can do it:
class Test
{
public:
private:
static const char EndByte[2] = {'\0xOD','\x0A'};
}
---------------------
Strength and honour.
Shadows and dust.
Sébastien ANDRE.
Actually, there is something like:
// this is in header file
class A
{
protected:
static const char* EndByte;
};
// this is in implementation file
const char* A::EndByte = "\0x0d\0x0a";