I am confused, I seem to be losing the variable item.Size when i go from one for loop to the next....why?
When i show item.Size the first time it shows all the #s, the second time I get straight 0s?
for (unsigned long int q = 0; q < tableCount; q++)
{
for each (AoE2Wide::DrsItem item in inTables[q].Items)
{
inFileDrs.read(reinterpret_cast<char*>(&id),sizeof(id));
inFileDrs.read(reinterpret_cast<char*>(&start),sizeof(start));
inFileDrs.read(reinterpret_cast<char*>(&size),sizeof(size));
item.Id = id;
item.Start = start;
item.Size = size;
std::cout << item.Size << std::endl;
}
}
// char *tempItem = new char[1];
// delete [] tempItem;
for (unsigned long int q = 0; q < tableCount; q++)
{
for each (AoE2Wide::DrsItem item in inTables[q].Items)
{
std::cout << item.Size << std::endl;
// tempItem = new char [item.Size];
// inFileDrs.read(tempItem, item.Size);
//item.Data.push_back(*tempItem);
// for (unsigned long int k = 0; k < item.Size; k++)
// item.Data.push_back(tempItem[k]);
// delete [] tempItem;
//std::cout << item.Data.size() << std::endl;
/*******************POSSIBLE ERROR ********************/
}
}