Seeing as I don't fully understand WHAT you are trying to achieve, that makes it very hard to explain how you SHOULD do that.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
So, you either size/resize your vector as need be, or you create a temporary object and add it using push_back().
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Well I know that. But nevermind, I thought there supposed to be a special way too initialize class vector objects.
Can I somehow declare the raceDB vector right after the class?Code:void LoadRaces() { vector<Races>racesDB; racesDB.push_back(Races(1, ANCIENA_S, "a", "a", "a", 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5)); racesDB.push_back(Races(2, ANCIENA_S, "a", "a", "a", 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5)); racesDB.push_back(Races(3, ANCIENA_S, "a", "a", "a", 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5)); }