So the header file has no actual content? Where is the class Sales_item defined?
Edit:
There's a section on operator overloads in the tutorial here. If you have a user defined type like a Sales_item class - you need to define how an operator like << should work.
I don't have the Lippman book, but I've got to think that a primer on C++ would include classes. What does the book say this particularly code snippet is trying to help illustrate?
You can get into the tutorial on this site through that link I posted above.
When I tried to compile that code, i got the following errors:
[Error] 'Sales_item' was not declared in this scope
[Error] expected ';' before 'item1'
[Error] 'item1' was not declared in this scope
[Error] 'item2' was not declared in this scope
That is to say, it fails before reaching line 12.
Does your compiler also give similar errors?
Well, it seems as though either the book hasn't explained things very clearly, or perhaps that code wasn't meant to be a complete runnable program, it was just to read through and then move on. Or maybe the book comes with a cd or web site where you can get the full cpp code.