Quote Originally Posted by Lindley View Post
What you are doing wrong is
Code:
values++;
in the loop. After that, values no longer points to the array returned by malloc(), so it is improper to pass it to realloc.

However, your start pointer should still be pointed at the proper location. Try passing that instead.
thanks. i forgot about that basic point.

Also, no program may be considered correct if it does not free() all allocated memory before program termination.
that point taken too! thanks.