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.

相关推荐
暗然而日章1 小时前
C++基础:Stanford CS106L学习笔记 4 容器(关联式容器)
c++·笔记·学习
巨人张2 小时前
C++火柴人跑酷
开发语言·c++
Gomiko4 小时前
C/C++基础(四):运算符
c语言·c++
freedom_1024_4 小时前
【c++】使用友元函数重载运算符
开发语言·c++
zmzb01034 小时前
C++课后习题训练记录Day43
开发语言·c++
赖small强4 小时前
【Linux C/C++开发】 GCC -g 调试参数深度解析与最佳实践
linux·c语言·c++·gdb·-g
CAE虚拟与现实5 小时前
C/C++中“静态链接(Static Linking)” 和 “动态链接(Dynamic Linking)释疑
开发语言·c++·dll·动态链接库·lib库
fpcc5 小时前
C++编程实践——标准库中容器存储目标分析
c++
包饭厅咸鱼5 小时前
PatchCore-----训练,测试,c++部署 工业异常检测框架
开发语言·c++·视觉检测
许长安5 小时前
C++ 多态详解:从静态多态到动态多态
开发语言·c++·经验分享·笔记