Hi,
I've a header file with the declaration of an int vector:
class BSet
{
[snip]
private :
std::vector<int> data;
[snip]
In the source file I'd like to initialize the vector with DEFSIZE copies
of "0" (where DEFSIZE is an int) within a contructor. My idea was to use
the standard vector constructor "vector<T> v(DEFSIZE,'0')" but all my
attempts failed.
I also used to try:
BSet::BSet()
{
for (int i=0; i < DEFSIZE; i++)
{
data[i] = 0;
}
[snip]
but this results in a "Segmentation fault" when accessing the elements
of the vector data.
Any idea how to use the standard constructor appropriately?
Thanks
Chris