#include ">

mylink.cpp - Lab 6 The"~Linklist~ Program Programmer...

Info icon This preview shows page 1. Sign up to view the full content.

// Lab 6, The "~Linklist~" Program // Programmer: Huaning Wang HERE // Editor(s) used: Visual Studio // Compiler(s) used: VC++ 2013 #include <iostream> #include <string> #include <sstream> #include "Linklist.h" using namespace std; int main(){ cout << "Lab 6, The \"~Linklist~\" Program \n"; cout << "Programmer: Huaning Wang\n"; cout << "Editor(s) used: Microsoft Visual Studio\n"; cout << "Compiler(s) used: VC++ 2013 \n"; cout << "File: " << __FILE__ << endl; cout << "Complied: " << __DATE__ << " at " << __TIME__ << endl << endl; NumberList list; cout << "\nPre list" << endl; list.appendNode(2); list.appendNode(7); list.appendNode(12); list.displayList(); cout << "what number to insert?" << endl;
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //insert 1 element string t; int num; getline(cin, t); stringstream(t) >> num; cout << "where to insert?(on the index pos1 = 0)" << endl; string a; int p; getline(cin, a); stringstream(a) >> p; list.insertNode(num, p); cout << "\nafter insert" << endl; list.displayList(); cout << "where to delete?(on the index pos1 = 0)" << endl; string te; // delete 1 element int num1; getline(cin, te); stringstream(te) >> num1; cout << "\nafter delete" << endl; list.deleteNode(num1); list.displayList(); cout << "\nafter delete all" << endl; list.deleteallList(); list.displayList(); system("pause"); return 0; }...
View Full Document

  • Fall '14
  • chern
  • getline, endl, cout

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern