How to initialize a const array with size defined in template before the constructor call??

template<int s>
class something
{
public:
 const int array[s];
 something(void) // uninitialized member `something<s>::array' with `const' type `const int[s]' 
 {
 }
};

razum

it dont says how to initialize an array...and especially not with size defiend in the template....

It doesn't matter how the size is defined, you can't initialize an array member arbitrarily like you can with local arrays. You can default initialize it, but that's about as good as it gets, and with a const array, it's not terribly useful:

template<int s>
class something {
  const int array[s];
public:
  something(): array() {}
};

Might I recommend the std::vector class instead of an array? Or remove the const qualifier and use assignment in the constructor as a poor man's initialization.

This question has already been answered. Start a new discussion instead.