Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My struct contains the pointer:
- // define a structure to hold bid information
- struct Bid {
- string bidId; // unique identifier
- string title;
- string fund;
- double amount;
- Bid *next;
- Bid() {
- amount = 0.0;
- next = NULL;
- }
- };
- void LinkedList::Append(Bid bid) {
- // FIXME (3): Implement append logic
- //reference bid being passed??? Bid struct has pointers, do we need another pointer?
- Bid *currNode = &bid;
- //set node's next pointer to NULL (end)
- currNode->next = NULL;
- //if list is empty
- if (head == NULL) {
- head = currNode;
- tail = currNode;
- }
- else {
- tail->next = currNode;
- tail = currNode;
- }
- }
Add Comment
Please, Sign In to add comment