// // p.168 // Linked List // #include using namespace std; struct NodeType { int info; NodeType* next; }; int main() { NodeType* temp = new NodeType; temp->info = 17; temp->next = NULL; NodeType* t1 = new NodeType; t1 -> info = 4; t1 -> next = temp; NodeType* head = new NodeType; head -> info = 12; head -> next = t1; // Q: Print the list? // cout << head->info << "\t" << head->next->info << "\t" // << head->next->next->info << "\n"; temp = head; while( temp != NULL ) // STOP: NULL { cout << temp->info << "\t"; temp = temp->next; // move the pointer forward } cout << "\n\n"; // Q: head->next->info: _4_ // Q: t1->next->info: ____ //Q: cout << temp; cout << "DEBUG: " << temp->info << endl; return 0; }