Want more features on Pastebin? Sign Up, it's FREE!
Guest

main.cpp

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.43 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2. using namespace std;
  3. #include "list.h"
  4.  
  5. int main()
  6. {
  7.      int m_value;
  8.     // instantiate a List class (the constructor takes NO arguments)
  9.     List list;
  10.  
  11.     // NOTE:
  12.     // List list();  is incorrect, when there are no arguments don't use ()
  13.  
  14.     // insert numbers into the list
  15.  
  16.     while (cin>>m_value)
  17.     {
  18.             list.insert(m_value);
  19.         }
  20.     list.print();
  21.     list.sum();
  22.    
  23.  
  24.  
  25.    return 0;
  26. }
clone this paste RAW Paste Data