hi guys,
I would like to serialize vector. And dunno how to change pointer of vector.. To make it simple let's say I have a vector smt like:
vector<char> v;
And I have this pointer:
char* c = { 'v', 'e', 'c', 't', 'o', 'r' };
And I would like my vector v's internal pointer points my char* c:
&v[0] -> c
How can I adjust vector that it would point c? Is there any way to do it?
Thanks!!!
/******** EDIT 22.10.2010 *********/
So guys, after debugging vector I came up with this solution:
vector dump; memcpy(&myVector, &dump, sizeof(myVector)); // I change contents so it can work myVector.assign(buf, buf+5); // copy contents into it from buffer (I don't like this part)
And to work this I needed to define
_ITERATOR_DEBUG_LEVEL=0
because it's initiallt set to 2 and it actually does a debug check (I guess) This is not defined in release mode also right? So it's my workaround for now, I would like to force ppl to remove vector in long term... So guys what are you thinking about this solution? And dangers you see?