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.

相关推荐
c++逐梦人10 小时前
C++11——— 包装器
开发语言·c++
十年编程老舅11 小时前
Linux 多线程高并发编程:读写锁的核心原理与底层实现
linux·c++·linux内核·高并发·线程池·多线程·多进程
wildlily842711 小时前
C++ Primer 第5版章节题 第十三章(二)
开发语言·c++
xiaoye-duck12 小时前
【C++:unordered_set和unordered_map】 深度解析:使用、差异、性能与场景选择
开发语言·c++·stl
老约家的可汗12 小时前
list 容器详解:基本介绍与常见使用
c语言·数据结构·c++·list
顶点多余12 小时前
线程互斥+线程同步+生产消费模型
java·linux·开发语言·c++
Albert Edison12 小时前
【ProtoBuf 语法详解】更新消息|保留字段|未知字段
开发语言·c++·protobuf
無限進步D13 小时前
算竞常用STL cpp
开发语言·c++·算法·竞赛
南境十里·墨染春水13 小时前
C++ 笔记 深赋值 浅赋值(面向对象)
开发语言·jvm·c++·笔记
今儿敲了吗13 小时前
算法复盘——差分
数据结构·c++·笔记·学习·算法