error: forming reference to void

The mistake is like the below picture:

The reason is Instantiation Object then call function, but displayMessage() function include cout function. After load this wrong, repair the Codes like the below picture:

The output result:

Good Luck!! I hope the answer could help you solve this problem.

相关推荐
闻道且行之6 小时前
TurboOCR:基于PP-OCRv6的极速Windows离线OCR工具,深度解析3.4GB依赖背后的技术架构
c++·人工智能·python·qt·机器学习·ocr
c238569 小时前
Bug 猎手入门指南
c++·算法·bug
玖玥拾10 小时前
C++ 数据结构 八大基础排序算法专题
数据结构·c++·算法·排序算法
YYYing.11 小时前
【C++大型项目之高性能服务器框架 (七) 】Socket与ByteArray模块
服务器·c++·后端·框架·高性能·c/c++
从零开始的代码生活_11 小时前
C++ list 原理与实践:双向链表、迭代器与简化实现
开发语言·c++·后端·学习·算法·链表·list
charlie11451419111 小时前
现代C++工程实践——WeakPtr 第二关:核心骨架与控制块
开发语言·c++
2401_8697695912 小时前
内容9 string 1
c++
ComputerInBook13 小时前
C & C++ 中的关键字 volatile 之详解
c语言·c++·volatile·编译器优化
XH华13 小时前
C++语言第二章类和对象(下)
开发语言·c++
从零开始的代码生活_13 小时前
C++ stack、queue 与 priority_queue:容器适配器原理与实战
开发语言·c++·后端·学习·算法