I have a structure (void *cbdata) in memory created from Fortran. It contains:
2 integers, then (up to) 100 doubles
I need to extract the ints and doubles. I am doing this on the C side:
but I get warnings:Code:int *nvar = (int *) cbData; double *vars = (double *)((int)cbData + 8);
ex_nlp3.c(33): warning C4311: 'type cast': pointer truncation from 'void *' to 'int'
ex_nlp3.c(33): warning C4312: 'type cast': conversion from 'int' to 'double *' of greater size
Both warnings relate to the double line of code.
How should I restructure this to eliminate the warnings?