/ Published in: C++
this doesn't work at all.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#include <iostream> #include "LinkedList.h" #include "LinkedNode.h" int main() { // our list LinkedList< int > list; //add a couple values list.add( 1000 ); list.add( 2000 ); // try to get them back out int val1 = list.get( 1 ); int val2 = list.get( 2 ); // output the result and wait for input std::cout << "val1: " << val1 << std::endl; std::cout << "val2: " << val2 << std::endl; std::cout << "list size: " << list.getSize() << std::endl; std::cin.ignore( std::cin.rdbuf()->in_avail() + 1 ); return 0; }