C ++ stepped pit - use memset to initialize the vector

In a program using memset of vector is initialized, and then get the wrong results. Find the bug took a long time.

vector has its own structure, not simply the byte initialized. Use memset to initialize the vector, it will destroy the structure of the vector, resulting in a data error vector. I use memset all the elements in the vector is set to 1, the final findings far.

Guess you like

Origin www.cnblogs.com/Peyton-Li/p/11926566.html