Click to See Complete Forum and Search --> : Arrays


Kohinoor24
March 6th, 2002, 03:14 AM
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

dede
March 6th, 2002, 03:37 AM
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.

cpitis
March 7th, 2002, 02:50 AM
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";