Hi. I have a file to read, in this format:
Code:
0,0,0,0,0,0,0,0,0,0,6,0x01
1,0,0,0,0,0,0,0,0,0,0,0x02
2,0,0,0,0,0,0,0,0,0,0,0x04
My function is this:
Code:
void Tile::ReadTileData(char* line)
{
	char* buffer;

	buffer = strtok (line, ",");
	while (buffer != NULL)
	{
		tile_data.push_back(atoi(buffer));
		buffer = strtok (NULL, ",");
	}
}
Now this reads all values fine and stores them as ints, but the last hex value is always stored as 0. Is there any way to get it to parse the string in as an int?