On Wed, Mar 25, 2009 at 11:04 AM, tom tan <ttan@husky.ca> wrote:


I need some dynamically allocated space that can later be casted to C pointers,
 so that it can be passed to a Win32 API function that accepts C pointers only.
vectors are dynamic, but they don't cast to C arrays naturally.
In fact, I am wrapping that API in C++. is there a better way?

The first paragraph of the C++ standard which describes vector class guarantees for verctor<T> (not vector<bool>) to provide the pointer to a continuous block of Ts by using: &vec[0]. vector<bool> is specialization which stores bool values bitwise.


Greetings,
Ovanes