This code runs fine in Windows, but seg faults in FreeBSD.
The red is what causes the seg fault. Anyone have any idea what the problem is?Code:#include <stdio.h> #include <stdlib.h> #include <unistd.h> struct s1 { unsigned int num; }; typedef struct my_s { struct s1 *foo; unsigned char[100]; }my_t; int main() { my_t *bar; bar = (my_t *)malloc(sizeof(my_t)); bar->foo->num = 10; printf("%d",bar->foo->num); reeturn 0; }