Hi,
> I am looking for a better way creating dynamic arrays in C. I have the
> following problem. First I create an array with the size 1 then I
> resized it to size 2 then to size 3 ... always by one as I do not know
> the final size. For size I use realloc, but doing it such way is very
> slow. Any better idea in C?
If you allocated n byte with realloc last time and you need n+1 or more,
allocate 2*n with realloc.
realloc already does so?
STL does something more clever?
Masatake