Topic: Initialisation of an array class attribute in a constructor declaration


Author: Geert Bevin <gbevin@arcadis.be>
Date: 1997/01/18
Raw View
Hello,

I have a problem with the initialisation of array attributes in a constructor
declaration. I know how to initialise regular attributes, but I can't find a
way to do it with arrays.

[I think this may be covered in the FAQ, but I don't remember for sure... --mod]

// Example:
// --------

class Test
{
    public:
        Test();
    private:
        int Integer;
        char Array[10];
};

Test::Test() :
        Integer(0),
        Array(?????)    // <- how do I initialise the array?
{
}

// ---------

Thanks for the help,

G. Bevin.
 _   _
//  //
\\_// G. Bevin
 \ /
  \\  gbevin@arcadis.be  - http://web.arcadis.be/bevin
   \\   _
    \\_//
     \_/


      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]