The more general problem is that you will have to know what the size of the variables were on the machine that WROTE the file, not the machine that is reading them. In other words, you can say sizeof(int) and get say 8 on some crazy 64 bit system, but if the file was saved on a normal 32 bit machine, sizeof(int) may be 4 (or even 2, according to ansi c, I think). The sizeof command will tell you the size of an int, or whatever, on your local machine at the time of compile. But it can't tell you anything about the machine that saved the file.
Your best bet is to see if the TDMS standard (I'm not familiar with it) defines variable sizes. If so, you should use those, rather than sizeof.
A poor second alternative is to have a test sequence at the beginning of the file and dynamically adjust your variable sizes until you can read the test sequence correctly.