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.

相关推荐
向上的车轮4 分钟前
语言特性适用的场景:卫星、火箭控制系统用什么开发语言?
java·开发语言·c++·c#·c·ada
Aderversa6 小时前
C++开源协程库async_simple有栈协程源码分析
c++·协程
uyeonashi6 小时前
【QT】窗口详解
开发语言·c++·qt·学习
Hello eveybody7 小时前
C++介绍整数二分与实数二分
开发语言·数据结构·c++·算法
空白木各7 小时前
evo工具
c++
编码小笨猪7 小时前
浅谈Linux中一次系统调用的执行过程
linux·服务器·c++
呃m10 小时前
双重特征c++
c++
景彡先生10 小时前
C++ 中文件 IO 操作详解
开发语言·c++
无影无踪的青蛙11 小时前
[C++] STL大家族之<map>(字典)容器(附洛谷)
开发语言·c++
二进制人工智能11 小时前
【OpenGL学习】(四)统一着色和插值着色
c++·opengl