Thomas Zhu a écrit :
> I often heard some words (I dont know the their English name , i
> translate them from my language to English):
> 1/memory leak
Meaning that some allocated memory can't be freed(). It may happen if
you loose the value of the pointer.
printf ("%p\n", (void *) malloc(123));
or more likely (Ok, strdup() not standard C but is POSIX.1, hence very
portable)
printf ("%s\n", strdup("Hello world"));
> 2/wild pointer
or 'dandling pointer'. An uninitialized pointer or a pointer to an
invalid zone (out of the limits of an array for example). As long as you
don't dereference it, it's fine (well, sort of). But if you dereference
it, it bites (UB).
--
C is a sharp tool
|