Linkedlists with multiple arrays

My semester just ended and I have an outstanding project I haven't finished that I would like to just so that I know what I'm doing. The idea is to create a linkedlist from input from the user from data inputted via a file into three arrays. The linkedlist is in place to keep track of the order, check/show the order and add/delete the order accordingly. Linkedlists was one of the last things we covered and I wasn't fully grasping the coding. I understand the what and why...just not so much the make-it-happen. Here is what I have:

I'm pretty sure this is right...?
1
2
3
4
5
6
7
8
class orderLinkedList
{
public:
	string itemArray;
	double quantArray;
	double priceArray;
	orderLinkedList *link;
};

below is the function for the creation of the node. This part I'm definitely sure is wrong. haha
1
2
3
4
5
6
7
8
9
10
11
12
orderLinkedList *createNode(int itemNum)
{
	newNode ->link = head;
	head = newNode;
	orderLinkedList *node;
	node = new orderLinkedList;
	node->itemArray = itemNum;
	node->quantArray = -itemNum;
	node->priceArray = itemNum;
	node->link = NULL;
	return node;
}

Below is what is in main:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
orderLinkedList *head;

	do
	{
		do
		{
			orderTotal=0;
			showData(itemArray, quantArray, priceArray);
			do 
			{
		
				itemNum = userSelectionCheck();
				if (itemNum != -1)
				{
					cout<<"\nYou have selected<<itemArray[itemNum]; 
					quantArray[itemNum] = quantArray[itemNum]-1;
					while (itemNum != -1 && quantArray[itemNum] < 0)
					{
						cout<<"\nSorry, there is no "<<itemArray[itemNum]<<" left.";
						cout<<"\nPlease make another selection. ";
						itemNum = userSelectionCheck();
					}
					orderLinkedList *createNode;
					cout<<"\nhead "<<head<<" newNode "<<newNode << " head->link "<<head->link;
					if (itemNum != -1)
					{
						price = priceArray[itemNum];
						orderTotal = price + orderTotal;
					}
					else{;}
				}
				else{;}
			}while (itemNum != -1); 



like I mentioned, I just want to know how to get do a linkedlist since I didn't get it right in class now that class is over. Thanks.
Topic archived. No new replies allowed.