当我制作2D矢量时.
std::vector<std::vector<Pokemon>> pokemons;
我可以马上运行吗:
Pokemon pikachu = ...
pokemons[23].push_back(Pikachu);
或者我需要:
pokemons.reserve(100);
for (int i =0;i<100;i++) pokemons.push_back(vector<Pokemon>());
谢谢
double test = 0.0;
.... some code
char qwe = ...
.. some code
test += qwe;
if (test >= 200 || test <= 300) {
test = 7.0;
}
// For some reason, test seems to equal 0?
Run Code Online (Sandbox Code Playgroud)
为什么(test >= 200 || test <= 300)== false?
这是非常奇怪的行为.
当我打印输出时,它是0?