Hey
I want to know if it's safe to use string and vector, which are in vector of structs:
1 2 3 4 5 6 7 8 9 10 11
|
struct Board
{
bool bProtected;
string sName;
vector <BYTE> vData;
};
int iSelectedBoard;
vector <Board> vBoards;
|
Then created
1 2 3 4
|
rdPtr->vBoards.push_back(Board());
rdPtr->vBoards[rdPtr->vBoards.size()-1].sName = p1;
rdPtr->vBoards[rdPtr->vBoards.size()-1].vData.resize(p2);
|
Or better to use array of structs instead of vector of structs?
Last edited on
Thanks.
It's cool because it's faster ( no more loop through all array elements ) and the size isn't const.