Mam taky mali problem s kodom:
struct Client {
TCPsocket sock;
char *name;
int stav;
};
vector<Client> players;
vector<Client> getPlayerList(TCPsocket sock, int &size) {
size = getInt(sock, NULL);
players.clear();
for(vector<Client>::size_type i = 0; i < size; i++) {
players.push_back(getPlayerListLine(sock));
}
return players;
}
Problem je v tom ze ked zavolam push_back tak my to sice structuru do vectoru vlozi ale vsetky prvky vectoru prepise podla posledneho. Nechapem preco :(. Nevedel by niekto cim to moze byt a podelil by sa zo mno zo svojimy vedomostami :).