#include <iostream>
#include <string>
#include "linebreaker2.h"
using namespace std;
int main()
{
// Read line.
cout << "I want your line: ";
string line;
getline(cin,line);
// Break the thing.
LineBreaker2 lb(line);
cout << "Found " << lb.size() << " words." << endl << endl;
for(int i = 0; i < lb.size(); i++)
cout << "(" << lb[i] << ") ";
cout << endl << endl;
for(char **scan = lb.c_arr(); *scan; ++scan)
cout << "[" << *scan << "] ";
cout << endl << endl;
char *oldlast = lb.pop_back();
if(oldlast)
cout << "old last is " << oldlast << endl;
else
cout << "old last is null. list must be empty." << endl;
for(char **scan = lb.c_arr(); *scan; ++scan)
cout << "[" << *scan << "] ";
cout << endl;
}