Hey,
first of all sorry about the poor discription of this topic but I would have no idea how else to describe this problem.
My code is as follows:
// -- Header --
// Structure HeightMap
struct HEIGHTMAP { USINT heightData[100*100]; };
// -- Source Main--
// Create A HeightMapLoader Object
classMapLoader MapLoader;
// Create TestMap
HEIGHTMAP TestMap;
// Load TestMap From Heightmap
MapLoader.LoadMap("Data//HeightMaps//Test.raw", &TestMap);
// -- Source Class LoadMap --
void classMapLoader::LoadMap(std::string mapPath, HEIGHTMAP* mapArray)
{
// Open mapPath And Load Data Into mapArray
std::ifstream InputFileMap;
InputFileMap.open( mapPath.c_str(), std::ios::in | std::ios::binary );
if (InputFileMap.is_open())
{
InputFileMap.read((char*)(*mapArray).heightData, sizeof(USINT) * 100 * 100);
InputFileMap.close();
this->Logger->Notify("Heightmap Opened Correctly! File: " + mapPath);
} else {
this->Logger->Error("Could Not Open Heigtmap File! File: " + mapPath);
}
return;
}
Now if I debug this in the LoadMap function mapArray has the structure of an std::string. Meening when I look at mapArray in the Watch window I get a structure like this:
- mapArray {...}
+ std::_String_val<char,std::allocator<char> > {...}
+ _Bx {...}
_Myres 0
_Mysize 0
npos 4294967295
The interesting thing is that everything seems to be working fine when I switch the order of arguments in LoadMap like this:
void classMapLoader::LoadMap(HEIGHTMAP* mapArray, std::string mapPath);
Now I'm not sure why this is and any help would be greatly appreciated. If there is any request for more code I'll post it asap.
Quinnie