Skip to content

Commit

Permalink
add error information
Browse files Browse the repository at this point in the history
  • Loading branch information
Queequeg92 committed Sep 22, 2014
1 parent c6cfc63 commit 069ae56
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ch15/ex15.15.16.17/bulk_quote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ double Bulk_quote::net_price(std::size_t n) const

void Bulk_quote::debug() const
{
Quote::debug();
std::cout //<< "data members of this class:\n"
<< "min_qty= " << quantity << " "
<< "discount= " << this->discount<< " \n";
<< "discount= " << discount<< " ";
}
5 changes: 3 additions & 2 deletions ch15/ex15.15.16.17/limit_quote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

void Limit_quote::debug() const
{
Quote::debug();
std::cout //<< "data members of this class:\n"
<< "max_qty= " << this->quantity << " "
<< "discount= " << this->discount<< " \n";
<< "max_qty= " << quantity << " "
<< "discount= " << discount<< " ";
}
5 changes: 5 additions & 0 deletions ch15/ex15.15.16.17/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

int main()
{
/*
error C2259 : 'Disc_quote' : cannot instantiate abstract class
1> due to following members :
1> 'double Disc_quote::net_price(size_t) const' : is abstract
*/
Disc_quote d;

return 0;
Expand Down
2 changes: 1 addition & 1 deletion ch15/ex15.15.16.17/quote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ void Quote::debug() const
{
std::cout //<< "data members of this class:\n"
<< "bookNo= " <<this->bookNo << " "
<< "price= " <<this->price<< " \n";
<< "price= " <<this->price<< " ";
}

0 comments on commit 069ae56

Please sign in to comment.