Je suis confronté à un petit problème, malloc et free font planter mon programme. Un petit tour dans la doc (http://tigcc.ticalc.org/doc/alloc.html#free) m'a donné cette indication:
Do not attempt to use free on a pointer which has changed after it was allocated with malloc, calloc, or realloc. For example, the following code will certainly crash the calculator:
char *ptr = malloc (2);
if (ptr)
{
*(ptr++) = 'A'; // pointer changed here
*ptr = 0;
...
free (ptr);
}
C'est justement ce que je fais

Mais je n'arrive pas à trouver d'alternative pour éviter ce problème.
C'est-à-dire allouer un tableau de char, le manipuler genre :
*(ptr++) = 'A'; // pointer changed here
puis le désallouer.
Merci d'avance
