c++ - C extend a pointer array -
I'm trying to expand an array of indicators using realloc, here's my minimum code:
I expand the array with this code:
YCSImage ** tabImages = NULL; For (Int i = 1; I and try to access the data with this code:
for (int i = 0; i I have not found any problems that the only problem is that imwrite () writes 5 times the previous image that I store in my expanded array. (As I give in my tab images for any index, I get only one photo tab image [4])
What's wrong with this code?
[edit]
I have tested this simple code that it has been working properly. The problem is that p_pixel_buffer is an indicator and changes in the loop every time so that the image is there.
You are starting all 5 images with the same data p_pixel_buffer . Are you modifying it later?
Comments
Post a Comment