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.

相关推荐
涤生z32 分钟前
list.
开发语言·数据结构·c++·学习·算法·list
FFZero11 小时前
【C++/Lua联合开发】 (三) C++调用Lua
c++·junit·lua
Source.Liu1 小时前
【BuildFlow & 筑流】品牌命名与项目定位说明
c++·qt·rust·markdown·librecad
bkspiderx1 小时前
C++设计模式之行为型模式:访问者模式(Visitor)
c++·设计模式·访问者模式
Q741_1472 小时前
C++ 面试基础考点 模拟题 力扣 38. 外观数列 题解 每日一题
c++·算法·leetcode·面试·模拟
L_09073 小时前
【Algorithm】二分查找算法
c++·算法·leetcode
祁同伟.4 小时前
【C++】多态
开发语言·c++
rechol4 小时前
C++ 继承笔记
java·c++·笔记
SunkingYang5 小时前
详细介绍C++中捕获异常类型的方式有哪些,分别用于哪些情形,哪些异常捕获可用于通过OLE操作excel异常
c++·excel·mfc·异常捕获·comerror
北冥湖畔的燕雀8 小时前
C++泛型编程(函数模板以及类模板)
开发语言·c++