Posted By: Zheka
Accessing T6 struct leads to a crash? - 01/26/22 17:35
This leads to a crash:
Why would this be?
Code
int main() { T6* t; t->fHigh =1; return 1; }
int main() { T6* t; t->fHigh =1; return 1; }
#include <default.c> #include <stdio.h> int main() { T6* t = malloc(sizeof(T6)); DATE ttime = dmy(20170101); t->time = ttime; // UTC timestamp of the close, DATE format t->fHigh =1; t->fLow =1; t->fOpen =1; t->fClose=1; t->fVal=0; t->fVol=0; // additional data, ask-bid spread, volume etc. //FILE* f = fopen("C:\\Zorro\\History\\USD_t.t6","w"); //if (f) fwrite(t,sizeof(T6),1,f); //fclose(f); free(t); return 0; }