I need two vectors as I do not want to define array-sizes without knowing how much I'll eventually need.
So I'll have one vector representing the clients which holds a vector representing data of those clients organised in structs.
a) Therefore I now have a vector for clients holding a vector for data which is organised in structs. That's this part:
1 2 3 4 5 6
<vector <vector<S> > v;
b) However, I am also having pointers representing instances of a certain script. I now have to combine those pointers with a) as I want to have the vectors organised with my instances. I thought I could do this with a map and later push_back new data somehow like that:
P.S: First day working with C++ - I work with Java and PHP more frequently.
What is the client? How is it identified? The phrase "Therefore I now have a vector for clients holding a vector for data which is organised in structs" is not clear,
Maybe you should keep the vector of data for a client inside the class defining the client as a private data-member.
Normally, I'd use a simple multi-dimensional array:
1 2 3 4 5 6
The problem is that I am not able to know how often data will be needed in that array - that's why I am now using vectors.
Clients are therefore just numerously defined.
You're right, I could create a class holding the clientID as an attribute and create for every new player a new object. Question is, is it more efficent to create hundrets of objects with one single vector in each of them or one vector holding another vector inside of it?