Posted By: panz
sizeof(TICK) getting 0? - 08/18/16 19:50
Some of the data import/export scripts depend on sizeof(TICK) to calculate the number of records in the binary content read from a file. However, when I made some changes to ExportBar.c so it can loop through multiple files, I found the script crashing. Some debugging showed that sizeof(TICK) is 0 in my script!
After a few failed attempts, I realized that there must be some combinations of codes in ExportBar.c that can trigger the compiler to give a correct value (24) to sizeof(TICK) (though "typedef struct TICK" is defined in trading.h and included while including default.c by default). I just couldn't find out what that condition is. Does anyone know about this?
An extremely simple example script that will show sizeof(TICK) as 0:
function main()
{
printf("\nsizeof(TICK)=%d\n", sizeof(TICK));
}
Thanks!
After a few failed attempts, I realized that there must be some combinations of codes in ExportBar.c that can trigger the compiler to give a correct value (24) to sizeof(TICK) (though "typedef struct TICK" is defined in trading.h and included while including default.c by default). I just couldn't find out what that condition is. Does anyone know about this?
An extremely simple example script that will show sizeof(TICK) as 0:
function main()
{
printf("\nsizeof(TICK)=%d\n", sizeof(TICK));
}
Thanks!