i**********r 发帖数: 36 | 1 【 以下文字转载自 Linux 讨论区 】
【 原文由 interstellar 所发表 】
does anyone know of reported bugs of the C function realloc in linux?
when i use this function, it works for the first few data sets,
then the program reports - segmentation error - and crashes.
I ran into such situations several times. And every time, i did tell
the program to free the memory. i have to use a tmp array to first remember
the old dynamic array, then malloc a new size and copy back the old values.
this is kind of stupid, are there any |
|