if you are sure that the file will only contain pairs of numbers, you can do this:
#include <fstream>
using namespace std;
fstream file;
file.open ( "name", ios::in );
if ( !file.is_open ( ) )
{
//error
}
file.seekg ( 0, ios::end ); //to the end
UINT fileSize = file.tellg ( ); //get the position at here (the end), this should be the file size
char* fileData = new char[fileSize + 1]; //allocated new memory to store file data in
file.read ( fileData, fileSize ); //fill in fileData with the data in the file
file.close ( );
//alright so our sting "fileData" contains what's in the file, basically loop through pairs and use atoi on them to convert them to numbers
for ( UINT i = 0; i < fileSize; i += 2 ) //+= 2 because we will read each 2
{
char tmp[3] = { '\0' }; //2 chars and a null terminator
tmp[0] = fileData[i];
tmp[1] = fileData[i+1]; //you can use memcpy instead, this is for demonstration
UINT curTile = atoi ( tmp ); //read the pair into a number
}
delete fileData; //free the data
either that, or do the same thing, but read them 2 by 2, i believe this one is more efficient in speed.