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.

相关推荐
帅气的小峰4 分钟前
pybind11与nanobind可以共存吗?如何迁移?
c++·python·cuda·推理引擎
syker16 分钟前
SuperNova Compiler v4.2.9 完整开发手册
c++
zhy2956321 分钟前
在 QAIRT Genie SDK 上部署 Llama 3.2 1B 模型:从环境准备到 C++ 推理
开发语言·c++·llama
richard_yuu42 分钟前
JSON vs XML vs 二进制:3种序列化终极选型
xml·c++·qt·学习·json
郝学胜-神的一滴1 小时前
并查集深度入门:从玄学抽象到 QuickFind & QuickUnion 源码实战
数据结构·c++·python·程序人生·算法·软件开发
ShineWinsu10 小时前
对于C++:IO流状态的详细解析
c++·面试·io·cin·io流状态·goodbit·failbit
Lzg_na11 小时前
constexpr的优势
c++
王维同学13 小时前
进程模块枚举、映像身份与线程启动地址关联
c++·windows·安全
hold?fish:palm13 小时前
24 回文链表
数据结构·c++·链表
举手13 小时前
Dispatcher模块剖析
linux·c++