本文整理汇总了C++中Author::getAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ Author::getAddress方法的具体用法?C++ Author::getAddress怎么用?C++ Author::getAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::getAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayBooks
void displayBooks(const vector<Book*>& books)
{
// set up cout to display currency
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
// display heading
cout << "\nRecommended Reading List\n";
// you provide the rest of this code
// display each account
for (int i = 0; i < books.size(); i++)
{
Author* pointer = books[i]->getAuthor();
cout << books[i]->getTitle() << '\n';
cout << pointer->getName() << '\n';
cout << pointer->getAddress() << '\n';
cout << books[i]->getPages() << " pages\n";
// use rtti to see what kind of object is being pointed to, and display the
// appropriate child class data values
AudioBook* bp = dynamic_cast<AudioBook*>(books[i]);
if (bp)
{
cout << "The length of this audio book is " << bp->getAudioLength() << " minutes." << endl;
}
else
{
DigitalBook* bp = dynamic_cast<DigitalBook*>(books[i]);
if (bp)
{
cout << "The format of this digital book is " << bp->getFormat() << endl;
}
} // end else
cout << '$' << books[i]->getPrice() << "\n\n\n";
}
}