void *memset(void *dest, int c, size_t count)
The 3rd argument is the Number of characters or bytes in the array. How would you memset an array of booleans, say bool bArray[11]?
MSDN says: "Security Note - Make sure that the destination buffer has enough room for at least count characters."
bool bArray[11] = {}
? Orstd::fill(begin(bArray), end(bArray), true)
?11 * sizeof(bool)
. That being said, that's not very c++; you should be usingstd::fill()
vector<bool>
is slow. You probably wantedstd::bitset
.vector<bool>
is also (surprisingly) not a normal container, unlikevector
. See explanation here: books.google.de/…