I define a class which hold some variables first:
class Command{
string cHandle;
int numPara;
vector<int> cPara;
public:
Command();
Command(string ucData);
//...............more functions here
}; //end of class definition
Then I declare an object of Command and wanna store it in a vector
vector<Command> cv;
Command c;
//... some operation of c, tested ok
cv.push_back(c); //segmentation fault here
The thing is if I only initial c.cHandle, everything ok
if I initial both c.cHandle and c.cPara[ ]
I got a segmentation fault at the last line
what could be my mistake? thanks.