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, 23.5);
- list_insert(head_ptr, 45.6);
- node *new_ptr = head_ptr->link();
- list_insert(new_ptr, 67.7);
- list_print(head_ptr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement