error: expected primary-expression before ‘.‘ token << Book.displayMessage()

The wrong is like the below picture:

The reason is Book isn't Instantiation Object, it must Instantiation that it could call function, and you need know the Code must out of cout Codes blocksdisplayMessage() function include cout contents.

The repair Codes like the below program:
Output result:

Good Luck!! I hope the answer could solve your problem.

相关推荐
hold?fish:palm9 小时前
kv存储主从复制的设计与实现
c++·redis·后端
啦啦啦啦啦zzzz10 小时前
算法:贪心算法
c++·算法·leetcode·贪心算法
charlie11451419110 小时前
现代C++工程实践 WeakPtr 实战(三):WeakPtrFactory 与「最后成员」惯用法
开发语言·c++·开源项目·现代c++
JetComXCpp12 小时前
给 Win32 窗口加上毛玻璃效果——纯 D3D11 实现,零依赖
c++
ysa05103014 小时前
【板子】二分答案(最大最小?)
c++·笔记·算法·板子
是多巴胺不是尼古丁14 小时前
C++基础知识
开发语言·c++
stolentime14 小时前
SP8549 MAIN75 - BST again题解
c++·算法·二叉树·深度优先·图论·记忆化搜索·组合数学
ziguo112215 小时前
C/C++ 错误处理全解:从 errno 到 C++ 异常
linux·c语言·c++·windows·visual studio
stolentime15 小时前
AT_pakencamp_2020_day1_k Gcd of Sum题解
c++·算法
2601_9561219715 小时前
map_计蒜客T1271 完美K倍子数组
c++·算法