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 分钟前
JsonCpp:C++ JSON处理利器
linux·网络·c++·json·tcp·序列化和反序列化
zmzb01031 小时前
C++课后习题训练记录Day38
开发语言·c++
獭.獭.1 小时前
C++ -- STL【string的使用】
c++·string·auto
福尔摩斯张2 小时前
Linux进程间通信(IPC)机制深度解析与实践指南
linux·运维·服务器·数据结构·c++·算法
lijiatu100862 小时前
C++ 类成员变量声明语法错误
java·开发语言·c++
zore_c2 小时前
【C语言】带你层层深入指针——指针详解2
c语言·开发语言·c++·经验分享·笔记
cookies_s_s2 小时前
项目--协程库(C++)前置知识篇
linux·服务器·c++
zmzb01032 小时前
C++课后习题训练记录Day39
数据结构·c++·算法
qq_310658512 小时前
mediasoup源码走读(二)环境搭建与 Demo 运行
服务器·c++·音视频
XiaoCCCcCCccCcccC4 小时前
多路复用 select -- select 的介绍,select 的优缺点,select 版本的 TCP 回显服务器
服务器·c++