[转载] help about C: realloc# Unix - 噫吁兮,危乎高哉
i*r
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
【 原文由 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