#include #include /* An example shows how $pointer_realloc works. */ int main() { int * p = (int *)malloc(sizeof(int) * 10); p[2] = 4; $pointer_realloc(p, sizeof(int) * 12); p[10] = 3; $assert(p[2] == 4 && p[10] == 3); $pointer_realloc(p, sizeof(int) * 4); $assert(p[2] == 4); #ifdef BAD $assert(p[10] == 3); #endif free(p); return 0; }