blob: 92aa0af64c9fd8650fafdc37c2e485c9d859527b [file] [log] [blame]
/* Similary to test 36, except with a struct instead of a union. */
#include <stdlib.h>
#include <stdio.h>
struct test {
char *ptr;
int value;
};
int main()
{
int *array;
struct test *t;
array = malloc(sizeof(int) + sizeof(struct test));
t = (struct test *) array;
t[0].ptr = (char *) array;
free(t[0].ptr);
printf("%i\n", array[0]);
return 0;
}