从文件中读取。问题是NodePTR Ptr
得到正确关联但Head
仍然NULL
。
template <typename ElementoPTR, typename Element, typename DetallePTR, typename Detail, typename Node, typename NodePTR>
void Arreglo<ElementoPTR, Element, DetallePTR, Detail, Node, NodePTR>::Registro(ifstream &entrada)
{
NodePTR Ptr = Head;
entrada >> Length;
for (int i = 0; i < Length; i++, Ptr = Ptr->Next) {
Ptr = new Node;
entrada >> Ptr->Dealer.CompanyName
>> Ptr->Dealer.AmountModels;
Ptr->Dealer.Modelo = new Detail[Ptr->Dealer.AmountModels];
for (int j = 0; j < Ptr->Dealer.AmountModels; j++)
entrada >> Ptr->Dealer.Modelo[j].ModelName >> Ptr->Dealer.Modelo[j].Sales;
}
}