FILE *infile;
infile = fopen("coords1.txt", "r");
int num = 0;
for(int num1 = 0; num1 < 5; num1++)
{
for(int num2 = 0; num2 < 4; num2++)
{
for(int num3 = 0; num3 < 3; num3++)
{
fscanf(infile, "%f", &num );
targetCoords[num1][num2][num3] = num;
}
}
}
I'm tired and its starting to stress me out so I have resorted to this forum.
Ok this is the file:
-1 -4 -10 1 -4 -10 1 -6 -10 -1 -6 -10 -5 -4 -40 -3 -4 -40 -3 -6 -40 -5 -6 -40 -1 -4 -70 1 -4 -70 1 -6 -70 -1 -6 -70 -1 -4 -100 1 -4 -100 1 -6 -100 -1 -6 -100 -1 -4 -130 1 -4 -130 1 -6 -130 -1 -6 -130
I've tried %f, %d, %i meh and nothing. Originally the numbers had .0 after each of them and tried the same, nothing - I have both the above and the .0's so whichever is best.
The array is a float array.
Any suggestions?