I am usiung MinGW as my c programing environment, but I found a serious problem. My test code is as follows:
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct { /* time struct */
time_t time; /* time (s) expressed by standard time_t */
double sec; /* fraction of second under 1 s */
} gtime_t;
typedef struct {
gtime_t time;
int type;
} raw_t;
int main(){
raw_t *t;
gtime_t t0={0};
t->time = t0;
printf ("%d",(t->time).time);
return 0;
}
I defined two struct and one struct is contained in the other one. When I run this test program, it will crush on line
t->time = t0;
Can someone help me on this?