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.

相关推荐
Lumbrologist21 小时前
【C++】零基础入门 · 第 1 节:第一个程序 Hello World 与编译运行
开发语言·c++
_李小白21 小时前
【C++学习笔记】新特性之inline变量
c++·笔记·学习
桀人1 天前
C++——模板初阶(收录在专栏C++入门到精通)
开发语言·c++
Lumbrologist1 天前
【C++】零基础入门 · 第 2 节:变量、基本数据类型与输入输出
java·开发语言·c++
XX風1 天前
CMake / Make / Ninja / MSVC / GCC / Clang / MSBuild —— 完整体系化理解
c++
Peter·Pan爱编程1 天前
10. new_delete 不是 malloc_free 的包装
c++·人工智能·算法
故事和你911 天前
洛谷-【动态规划1】动态规划的引入2
开发语言·数据结构·c++·算法·动态规划·图论
fpcc1 天前
c++编程实践——历史记录的管理
c++
玖笙&1 天前
✨WPF编程基础【3.3】:容器控件(附源码)
c++·wpf·visual studio
汉克老师1 天前
GESP5级C++考试语法知识(十七、二分算法提高篇(二))
c++·算法·二分算法·gesp5级·gesp五级·二分算法易错点