|
-
March 6th, 2002, 04:14 AM
#1
Arrays
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
-
March 6th, 2002, 04:37 AM
#2
Re: Arrays
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.
-
March 7th, 2002, 03:50 AM
#3
Re: Arrays
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";
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|