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.

相关推荐
HugoStudio_SWAN12 分钟前
洛谷 P10719 \[GESP202406 五级] 黑白格——暴力美学与图像处理的最小外接矩形
c++·图像处理·人工智能·学习·程序人生·算法·目标跟踪
jimy123 分钟前
C++ 的 “移动语义”——Move Semantics
开发语言·c++
励志不掉头发的内向程序员3 小时前
【LibreCAD 2D架构】从鼠标点击到图形创建:RS_ActionDrawLine交互流程与状态机解析
开发语言·c++·qt·学习·系统架构·计算机外设·交互
OPEN-F3 小时前
ROS2系列教程:Gazebo插件(关节控制/IMU/激光雷达)
c++·python·数码相机·算法·机器人
蒸蒸yyyyzwd3 小时前
cpp 选手秋招学习笔记 day27
服务器·c++·面试·八股
haolin123.4 小时前
STL vector底层揭秘:从构造到迭代器失效
开发语言·c++·算法
尘中远4 小时前
给C++工业软件搭建 Agent
开发语言·c++·qt·ai·agent
2401_868534784 小时前
网规备考_2.4 路由协议
c++·设计模式
啦啦啦啦啦zzzz4 小时前
自定义日志缓冲区(上)c++20
linux·服务器·c++·网络编程
wabs6664 小时前
关于二叉树【力扣199.二叉树的右视图的思考】
数据结构·c++·算法·leetcode·二叉树·层序遍历