debug src: http://www.cppblog.com/Files/mymsdn/cvector-bug-vs2008-201007101651.zip
Hey all, I have repair my code, thanks yours help! You can download the correct version of my code.
src: http://www.cppblog.com/Files/mymsdn/cvector-vs2008-20100710.rar
I am trying to write a C language version of vector. I use the void ** a
the pRoot indicate the pointer vector. I want to keep the void ** p available, than I malloc a memory.
like this :cvector_ptr_ptr = &cvector_ptr;
I pass the cvector_ptr_ptr
to each function to deal with it.
In my code, I encounter a unhandled exception. I think I have read overrun. But in the function "insert"
, I can use (*cvector_ptr_ptr)->element_size
to get the size value. I pass the cvector_ptr_ptr
to the function "insert_copy"
I can't use the same code [(*cvector_ptr_ptr)->element_size]
to get the value.
What's wrong with me?