D
Daniele
Hi,
My problem is the manage of a dynamic vector in a list of structures.
In the .hpp file I define the struct and the vector v.
typedef struct Word
{ char* Name;
vector<int> v;
Word* Next;
Word()
{Next=NULL;
Name=NULL;
}
};
typedef Word* ListPtr;
In the .cpp file I create a struct and I would to manage the vector inside
this structure,, like ie: clear it.
The point, in the .cpp file, where I define the struct is....
CList:: CList()
{
int i;
Head = new Word;
Tail=Head;
CurrentPtr = Head;
v.pushback(10); //It return me an error about the undeclared function
pushback
for (i=0;i<10;i++)
Tail->v=1; //It return me a Segmentation Fault
}
I'm unable to make everything with this vector.
Can you help me?
Thanks
Daniele
"Il saggio non schiaccia gli
altri con la sua superiorità ; non
li umilia mettendo in rilievo la
loro incapacità ."
Confucio
My problem is the manage of a dynamic vector in a list of structures.
In the .hpp file I define the struct and the vector v.
typedef struct Word
{ char* Name;
vector<int> v;
Word* Next;
Word()
{Next=NULL;
Name=NULL;
}
};
typedef Word* ListPtr;
In the .cpp file I create a struct and I would to manage the vector inside
this structure,, like ie: clear it.
The point, in the .cpp file, where I define the struct is....
CList:: CList()
{
int i;
Head = new Word;
Tail=Head;
CurrentPtr = Head;
v.pushback(10); //It return me an error about the undeclared function
pushback
for (i=0;i<10;i++)
Tail->v=1; //It return me a Segmentation Fault
}
I'm unable to make everything with this vector.
Can you help me?
Thanks
Daniele
"Il saggio non schiaccia gli
altri con la sua superiorità ; non
li umilia mettendo in rilievo la
loro incapacità ."
Confucio