Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 03. Order.cpp : This file contains the 'main' function. Program execution begins and ends there.
- //
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <vector>
- #include "Company.h"
- #include "OrderedInserter.h"
- int main() {
- using namespace std;
- vector<const Company*> companies;
- OrderedInserter inserter{ companies };
- string line;
- while (getline(cin, line) && line != "end") {
- istringstream lineIn(line);
- Company* c = new Company();
- lineIn >> *c;
- inserter.insert((const Company*)c);
- }
- for (auto companyPtr : companies) {
- cout << *companyPtr << endl;
- delete companyPtr;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment