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.

相关推荐
2401_8846022719 小时前
程序人生-Hello’s P2P
c语言·c++
初中就开始混世的大魔王19 小时前
2 Fast DDS Library概述
c++·中间件·信息与通信
娇娇yyyyyy20 小时前
C++基础(6):extern解决重定义问题
c++
Neteen20 小时前
【数据结构-思维导图】第二章:线性表
数据结构·c++·算法
灰色小旋风21 小时前
力扣——第7题(C++)
c++·算法·leetcode
Ralph_Y1 天前
C++网络:一
开发语言·网络·c++
程序猿编码1 天前
探秘 SSL/TLS 服务密码套件检测:原理、实现与核心设计(C/C++代码实现)
c语言·网络·c++·ssl·密码套件
故事和你911 天前
sdut-程序设计基础Ⅰ-实验二选择结构(1-8)
大数据·开发语言·数据结构·c++·算法·优化·编译原理
像素猎人1 天前
数据结构之顺序表的插入+删除+查找+修改操作【主函数一步一输出,代码更加清晰直观】
数据结构·c++·算法
蜡笔小马1 天前
32.Boost.Geometry 空间索引:R-Tree 接口详解
c++·boost·r-tree