I am currently using some explicit array definition like the following in my code:
double * p = new double[5]{
0.029426, 0.029366, 0.029281, 0.029157, 0.028979
};
but with much bigger array-sizes. The reason I do this is, because I get the data in this ASCII text-form and want to be able to add it directly as binary data to the created DLL. Swapping the text before compiling is automated, but I want to avoid additional pre-compilation steps.
Now I've noticed two things:
a) compiling this code becomes really slow for larger arrays
b) the resulting DLL is much bigger than the array's binary data size should be
c) If I change double to float this does not really change the DLL size
All of this makes me wonder if there is not a (much) better way to do it, but so far I haven't found an answer here on SO which helped me, although I've seen a couple of related questions.
Can somebody explain why I see b) and c)?
Can somebody suggest a better method that takes (float/double) data as ASCII and embeds it as binary in a DLL but doesn't require pre-compilation steps?
Other hints or suggestions are also welcome.