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++(斗罗大陆3)
开发语言·c++·斗罗大陆3
coderxiaohan1 小时前
List列表
c++
无双@1 小时前
高并发内存池9 —— Page Cache 回收
c++·线程·秋招·项目·高并发内存池·c++项目·内存池
卡提西亚2 小时前
C++笔记-26-类模板
c++·笔记
沐怡旸2 小时前
【穿越Effective C++】条款19:设计class犹如设计type——用户定义类型的艺术与科学
c++·面试
一个不知名程序员www2 小时前
算法学习入门---模拟(C++)
c++·算法
夜月yeyue2 小时前
嵌入式开发中的 Git CI/CD
c++·git·单片机·嵌入式硬件·ci/cd·硬件架构
编程之路,妙趣横生2 小时前
类和对象(下)
c++
Q741_1473 小时前
C++ 面试高频考点 链表 迭代 递归 力扣 25. K 个一组翻转链表 每日一题 题解
c++·算法·链表·面试·递归·迭代
syker4 小时前
手搓UEFI.h
c++