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.

相关推荐
渡我白衣28 分钟前
深入理解 Transformer:Transformer 究竟是什么?
java·linux·开发语言·c++·人工智能·深度学习·transformer
「QT(C++)开发工程师」8 小时前
C++ 11 常用for循环
开发语言·c++
我还记得那天9 小时前
0 初识C++
开发语言·c++
「QT(C++)开发工程师」11 小时前
C++ std::move 详解
开发语言·c++
豆沙沙包?13 小时前
C++~~~set容器、map容器(p57-P69)
开发语言·c++
qeen8714 小时前
【数据结构】哈希表的C++实现与封装
数据结构·c++·散列表·哈希表
乐观勇敢坚强的老彭15 小时前
C++信奥GESP四级的常见题型和解题模板速查表
开发语言·c++
欧特克_Glodon16 小时前
OpenCV计算机视觉开发入门与实践<二十二>:图像平滑之线性滤波
c++·人工智能·opencv·计算机视觉
沙盘客16 小时前
AFSIM 示例解读(09)· 传感器全家桶 sensor_demos(下):ESM / SAR / 被动测向
c++·经验分享·后端