// main3.cpp, third file of a number in mp3pieces project // By RPF 5/24/2000 // add a print() to Node // and work with linked list, but no hash table yet. // most important is to insert a few nodes. // so that's done here and in the definition in defines.cpp #include "mp3Header.h" void main() { cout << "main3.cpp -- create a node with two args and print().\n\n"; Node* node1 = new Node(1792503, "odd planet_zorg"); node1->print(); // a LinkedList item: LinkedList* lnk1 = new LinkedList(); cout << "\nnew LinkedList length should be 0, and = " << lnk1->length << "\n"; // Now create another node and insert it // and check that they're there. Node* node2 = new Node(2, "very even planet"); /* simple manual insert (doesn't update length) would be: lnk1->head = node1; lnk1->head->next = node2; */ // But our next task is to test inserting nodes into lnk1 lnk1->insertNode(node1); lnk1->insertNode(node2); cout << "length should now be 2: " << lnk1->length << "\n"; // Now we can try out function to print the list // and that's enough for main3. lnk1->print(); // to end run and close console window. cout << "\nDon't forget to enter an int when done.\n"; int i; cin >> i; }