jsmith
You suggestion , decreased time a little bit for vector.
Btw , I get different results with different compilers.
With Dev-C++ IDE version 4.9.9.2, total time of vector is 6 times bigger than total time of array. But with Microsoft Visual C++ 6.0 total time of vector is quite small, nearly equal to array.
Result of Dev-C++
For Array , 46
For Vector , 298
Result of Microsoft Visual C++ 6.0
For array , 78
For Vector , 109