Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Lab9.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include "node.h"
- #include <iostream>
- using namespace std;
- void list_print(node *head_ptr)
- {
- const node *cursor;
- for (cursor = head_ptr; cursor != NULL; cursor = cursor->link())
- {
- cout << head_ptr->data() << " ";
- }
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- //23.5, 45.6, 67.7, 89.8, 12.9
- node *head_ptr;
- list_head_insert(head_ptr, 20);
- list_insert(head_ptr, 40);
- node *node_tail= head_ptr->link();
- list_insert(head_ptr,30);
- list_insert(node_tail,45.6);
- node *new_node = node_tail->link();
- list_insert(new_node, 67.7);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement