All of this happens in my single loop. I create temporary variables for X, Y, and 3 strings.
The text file has 320 lines, which look like this:
1 2 "string" "stringy" "stringed"
int1 int2 string1 string2 string3
int1 int2 string1 string2 string3
int1 int2 string1 string2 string3
int1 int2 string1 string2 string3
And the loop code is here:
for(int Y = 0;Y < 320 ;Y++)
{
int tempX;
int tempY;
char tempRegionName;
char tempTXTfile;
char tempIMGfile;
fscanf(FileHandle, "%d %d %s %s %s ", &tempX, &tempY, &tempRegionName, &tempTXTfile, &tempIMGfile);
cout<<"X: "<<tempX<<" Y: "<<tempY<<" Name: "<<tempRegionName<<" TXT: "<< tempTXTfile << " IMG: " << tempIMGfile << endl;
}
When I debug, let's say the line it reads is this :
1 2 "string" "stringy" "stringed"
It then does this.
tempX = 1
tempY = 2 (tempX is now 0)
tempRegionName = "string" (tempY is now 0)
tempTXTfile = "stringy" (tempReginoName is now null)
tempIMGfile = "stringed" (tempTXTfile is now null).
Then it outputs this:
X: 1 Y: 0 NAME: TXT: IMG: stringed
I am not understanding this. I tried to follow the examples I found on using fscanf, and another example of code works using %d:%d. I tried replacing the spaces with :, but it obviously isn't the white space.
Looking it up on cplusplus, I am having a bit difficulty understanding. Maybe I'm just tired, but what am I doing wrong?