Hello..!
I have this problem:
Following shows allocation of my struct:
///////////////////////////////////////////
FOO **foo;//this is my struct
FOO **reallocfoo;//this is an extra pointer
foo=(FOO **)malloc(StartNumber*sizeof(FOO*));
for(int c=0;c<StartNumber;c++)
{
ILChild[c]=new ImageLocaterData;
}
....
foo[Number]=...
....
///////////////////////////////////////////
This works well...!
Then I want to Realloc som more space for my foo.
Strangely I can only allocate space for my pointer 44 times...!!?
Following shows the code to realloc:
///////////////////////////////////////////
reallocfoo=(FOO**)realloc(foo,(StartNumber+(Reallo cInc*(Counter+1)))*sizeof(FOO*));
for(int c=StartNumber+(ReallocInc*Counter)-1;c<StartNumber+(ReallocInc*(Counter+1));c++)
{
reallocfoo[c]=new FOO;
}
foo=reallocfoo;
Counter+=1;
///////////////////////////////////////////
44 times that dosn't make sense...
Please help or I'll just keep writing :) - or something...
Regards Henrik Tomra