CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Arrays

  1. #1
    Join Date
    Oct 2001
    Posts
    745

    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

  2. #2
    Join Date
    Jan 2002
    Location
    France
    Posts
    91

    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.

  3. #3
    Join Date
    Feb 2002
    Posts
    81

    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
  •  





Click Here to Expand Forum to Full Width

Featured