Ok so I have some code:
Code:
void loadBuildingImagesInfo()
{
int count, number;
double numbertest;
FILE *infile;
infile = fopen("BuildingImages.txt", "r");
for(count = 0; count < 16; count++)
{
for(number = 0; number < 32; number++)
{
fscanf(infile, "%f", &numbertest);
printf("%f - ", numbertest);
buildingImages[count][number] = numbertest;
}
}
}
In the textfile I have:
0.55 0.085 0.55 0.16 0.71 0.16
(this is just a few, having 512 numbers on this post is a bit absurd)
However, I cannot seem to get these numbers out, I tried print whats being read out, to test, and its just displaying some random long negative number, this is the first one:
-92559604195412477000000000000000000000000000000000 000000000000.000000
I have no idea how to go about this. both the array is a double and so is numbertest. so not sure. I have tried changing the %f to things like %1.2f etc. but no difference,
Thanks