Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // Lab9.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "node.h"
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. void list_print(node *head_ptr)
  10. {
  11. const node *cursor;
  12. for (cursor = head_ptr; cursor != NULL; cursor = cursor->link())
  13. {
  14. cout << head_ptr->data() << " ";
  15. }
  16. }
  17.  
  18. int _tmain(int argc, _TCHAR* argv[])
  19. {
  20. //23.5, 45.6, 67.7, 89.8, 12.9
  21. node *head_ptr;
  22. list_head_insert(head_ptr, 23.5);
  23. list_insert(head_ptr, 45.6);
  24. node *new_ptr = head_ptr->link();
  25. list_insert(new_ptr, 67.7);
  26.  
  27. list_print(head_ptr);
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement