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.

相关推荐
OOJO4 小时前
c++---list介绍
c语言·开发语言·数据结构·c++·算法·list
会编程的土豆7 小时前
【数据结构与算法】动态规划
数据结构·c++·算法·leetcode·代理模式
6Hzlia8 小时前
【Hot 100 刷题计划】 LeetCode 78. 子集 | C++ 回溯算法题解
c++·算法·leetcode
所以遗憾是什么呢?8 小时前
【题解】Codeforces Round 1081 (Div. 2)
数据结构·c++·算法·acm·icpc·ccpc·xcpc
白藏y9 小时前
【C++】muduo接口补充
开发语言·c++·muduo
xiaoye-duck9 小时前
《算法题讲解指南:递归,搜索与回溯算法--综合练习》--14.找出所有子集的异或总和再求和,15.全排列Ⅱ,16.电话号码的字母组合,17.括号生成
c++·算法·深度优先·回溯
OOJO9 小时前
c++---vector介绍
c语言·开发语言·数据结构·c++·算法·vim·visual studio
Tanecious.10 小时前
蓝桥杯备赛:Day5-P1706 全排列问题
c++·蓝桥杯
胖咕噜的稞达鸭10 小时前
C++技术岗面试经验总结
开发语言·网络·c++·网络协议·tcp/ip·面试
Wild_Pointer.10 小时前
高效工具实战指南:从零开始编写CMakeLists
c++