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.

相关推荐
机器视觉知识推荐、就业指导2 小时前
C++/Qt 联合编程中的定时器使用陷阱:QObject::startTimer 报错详解
c++·qt
慢半拍iii2 小时前
数据结构——D/串
c语言·开发语言·数据结构·c++
邪恶的贝利亚2 小时前
从基础到实战-rmpt to webrtc
c++·webrtc·rtmp·流媒体
whoarethenext3 小时前
使用 C/C++ 和 OpenCV 提取图像的感兴趣区域 (ROI)
c语言·c++·opencv
小玺玺3 小时前
[RDK X5] MJPG编解码开发实战:从官方API到OpenWanderary库的C++/Python实现
c++·python·opencv·rdk x5
德先生&赛先生3 小时前
深入理解c语言中的static
c++
景彡先生4 小时前
C++ 中的 iostream 库:cin/cout 基本用法
开发语言·c++
SundayBear7 小时前
适合有C基础后快速上手C++
开发语言·c++
顾三殇7 小时前
【自考】《计算机信息管理课程实验(课程代码:11393)》华师自考实践考核题型解析说明:C++ 与 mysql 实践题型与工具实践题分析
c++·mysql·华师自考实践考核题型分析
newki7 小时前
【NDK】项目演示-Android串口的封装工具库以及集成的几种思路
android·c++·app