Hi all,
i was doing the following:
so i got the warning:Code:for (int i = 0; i < numbers.capacity(); i++) {
numbers.push_back(rand() % 30);
}
i get the same warning if i use "auto" instead of "int" :Code:warning C4018: '<': signed/unsigned mismatch
i get only rid of the warning when i use "unsigned int".Code:for (auto i = 0; i < numbers.capacity(); i++) {
numbers.push_back(rand() % 30);
}
My question:
itsn't that where "auto" is supposed to help? so that i don't need to bother aboutthe data type ?
what i am i doing wrong? is there some best practice where not to use "auto" ?
i used a lot with range based for loops, it works fine
Thanks in advance