Lots of problems with this.
It's missing a couple of required headers:
1 2 3
|
#include <string>
#include <fstream>
|
Several problems with line 7:
1) Invoking the vector template with an allocator parameter, but you have no allocator.
2) What are the () at the end of the line?
3) No semicolon at the end of the line.
4) retrieve_test is never used.
Line 16: Proper return values for main are 0 or 1, not -1.
Line 19: Why is vector being dynamically allocated. That's just wrong.
Line 28. Flat wrong. That should be a simple <.
Line 34: Linenum is misspelled.
Line 36: Trying to return a vector pointer as the result of main. Makes no sense.
And finally, there is a memory leak. The dynamically allocated line_of_text is never released. Maybe line 36 was supposed to be
delete
, not
return
.
Apparently no one proofread the code in the book.