Maggistro wrote:
you are storing the whole produkt information in the buyerList
file? |
No; I am storing the product info in the product text file. I do not have any
problems with loading the product file into a
productListType object (which is essentially a linked list). However, as I've already explained, I am
trying to load the buyer file contents into a
buyerListType object using the
setCustomerInfo() member function above. How do I use formal parameter
p (which is a pointer) to access the product info part of the buyer text file (that I illustrated above) so that I could load this into the private data object,
productBoughtRecord, of each
buyerListType object???
upX86 wrote:
If it is so then in this scenario for maintaining the inventory
linked list data structure is inappropriate. |
I have no choice, the problem requires me to use linked lists. Moreover, like I already stated, I have successfully been able to create a
productListType linked list object; so, it being a
linked list data structure is not the problem. But in that case, the class's member function that does the setting of the data members does not have a pointer formal parameter like class
buyerListType's version.
If you guys look at my penultimate post, I gave actual examples of how the buyer text file data look like. What I am trying to do is read each buyer's data and insert that data into a
buyerListType object. If you look at the member function below:
void setCustomerInfo(string firstName, string lastName, int acctNo, productListType* p);
Take the case of
Henry Baker's data in that buyer/customer text file illustration above, you can see that I can easily read Henry into
firstName, read Baker into
lastName, read 2786493 into
acctNo; now, how do I get the pointer that references Product#1 data and Product#2 data??? How can I access these product data, uniquely Henry Baker's, in this sense?