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.

相关推荐
岁忧9 分钟前
(LeetCode 面试经典 150 题 ) 11. 盛最多水的容器 (贪心+双指针)
java·c++·算法·leetcode·面试·go
蜉蝣之翼❉5 小时前
CRT 不同会导致 fopen 地址不同
c++·mfc
aramae5 小时前
C++ -- STL -- vector
开发语言·c++·笔记·后端·visual studio
lixzest6 小时前
C++ Lambda 表达式详解
服务器·开发语言·c++·算法
_Chipen7 小时前
C++基础问题
开发语言·c++
灿烂阳光g7 小时前
OpenGL 2. 着色器
c++·opengl
AA陈超8 小时前
虚幻引擎UE5专用服务器游戏开发-20 添加基础能力类与连招能力
c++·游戏·ue5·游戏引擎·虚幻
mit6.8248 小时前
[Meetily后端框架] AI摘要结构化 | `SummaryResponse`模型 | Pydantic库 | vs marshmallow库
c++·人工智能·后端
R-G-B8 小时前
【02】MFC入门到精通——MFC 手动添加创建新的对话框模板
c++·mfc·mfc 手动添加创建新的对话框
linux kernel9 小时前
第七讲:C++中的string类
开发语言·c++