title: Can I cast std::vector<int>* to int*?
body: <p>Let's say I have a <code>std::vector&lt;int&gt;* foo;</code> and I have to use it as <code>int*</code> (array of int, not pointer to an int) for an old C type library PVM. As far as I am concerned this might work since the <code>vector</code> stores it's elements next to each other in memory just like arrays. So I tried <code>(int*)foo</code>, but somehow I get an error which I'm unable to debug, so I think this must be the problem. Any ideas, thoughts, elegant workarounds?</p>