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 blocks[displayMessage() function include cout contents.]

The repair Codes like the below program:
Output result:

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

相关推荐
第七序章14 分钟前
【C + +】红黑树:全面剖析与深度学习
c语言·开发语言·数据结构·c++·人工智能
夜晚中的人海18 分钟前
【C++】滑动窗口算法习题
开发语言·c++·算法
AA陈超42 分钟前
虚幻引擎5 GAS开发俯视角RPG游戏 P06-09 玩家等级与战斗接口
c++·游戏·ue5·游戏引擎·虚幻
·白小白1 小时前
力扣(LeetCode) ——118.杨辉三角(C++)
c++·算法·leetcode
tongsound1 小时前
libmodbus 使用示例
linux·c++
sulikey1 小时前
C++的STL:深入理解 C++ 的 std::initializer_list
开发语言·c++·stl·list·initializerlist·c++标准库
代大大2 小时前
sciter.js 之cpp使用教程(1)
c++·前端框架
仰泳的熊猫2 小时前
LeetCode:207. 课程表
数据结构·c++·算法·leetcode
liu****2 小时前
19.map和set的封装
开发语言·数据结构·c++·算法
孤廖2 小时前
C++ 模板再升级:非类型参数、特化技巧(含全特化与偏特化)、分离编译破解
linux·服务器·开发语言·c++·人工智能·后端·深度学习