本文整理汇总了C++中Quote::debug方法的典型用法代码示例。如果您正苦于以下问题:C++ Quote::debug方法的具体用法?C++ Quote::debug怎么用?C++ Quote::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quote
的用法示例。
在下文中一共展示了Quote::debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Quote q("aaa", 10.60);
Bulk_quote bq("bbb", 111, 10, 0.3);
Limit_quote lq("ccc", 222, 10, 0.3);
/** @note Not dynamic binding!
* The codes below are not dynamic binding. The compiler has known what the
* r refering to at compile time. As a result, the virtual function debug of
* the subobject is called.
*/
Quote *r = &q;
r->debug();
std::cout << "\n";
r = &bq;
r->debug();
std::cout << "\n";
r = &lq;
r->debug();
std::cout << "\n";
std::cout << "====================\n";
q.debug();
bq.debug();
lq.debug();
print_debug(q);
print_debug(bq);
print_debug(lq);
return 0;
}
示例2: main
// for test
int main(int argc, char **argv)
{
Quote q("asd", 10.5);
Bulk_Quote b_q("fuck", 10.5, 20, 0.2);
Quote *p;
p = &q;
cout << "20本asd的总价格为:" << p->net_price(20) << endl;
p->debug();
p = &b_q;
cout << "20本fuck的总价格为:" << p->net_price(20) << endl;
p->debug();
system("pause");
return 0;
}
示例3: print_total
double print_total(ostream &os, const Quote &item, size_t n)
{
double ret = item.net_price(n);
os << "ISBN: " << item.isbn()
<< " # sold: " << n << " total due: " << ret << endl;
item.debug();
return ret;
}
示例4: print_debug
void print_debug(const Quote &q)
{
q.debug();
}
示例5: print_debug
void print_debug(const Quote& item)
{
item.debug();
}