initialize a class with array member data
Given the below snippet from a class:
//////////////////////////////////////////////////
class safearray
{
private:
static const int LIMIT = 10;
int array[LIMIT];
public:
safearray()
{ }
//////////////////////////////////////////////////
Is there any way to use a constructor to setup array[] so that the item at index n is zero (or any other int)? I know how to set it up for other types - ie:
classname() : int(0)
{ }
or
classname(int a) : int(a)
{ }
but I'm not having any luck doing this for arrays.
Thanks for any help.
Matt