[ Post New Message | Post Reply to this One | Send Private Email to Mike Mannakee | Help ]

Why isn't this an infinite loop?

from Mike Mannakee (B3FEETBACK@AOL.com)
This one has me truly stumped:
void StockItem::Reorder(ostream& os)
{
  m_Worker->Reorder(os);
}

void DatedStockItem::Reorder(ostream& os)
{
  if (m_Expires < Today())
    {
    os << "Return " << m_InStock << " units of " << m_Name;
    os << " with UPC " << m_UPC;
    os << " to " << m_Distributor << endl;
    m_InStock = 0;
    }
  StockItem::Reorder(os);
}
these were cut and pasted from your source code. Why don't these two form an infinite loop? From what I can see, they would. I have not compiled and run the program to test it, but I cannot see how this would not be a problem.
(posted 9090 days ago)

[ Previous | Next ]