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.

相关推荐
lengxuenong4 分钟前
树状数组 · 信息学学习手册3-优化LIS
c++·学习·算法
fanfan_hongyun14 分钟前
【UE5.1 创建C++文件】
c++·ue5
余额瞒着我当琳21 分钟前
C++11,发展历史浅谈,初始化列表和对象初始化,右值引用和移动语义
java·开发语言·c++·算法
Tsuki_tl38 分钟前
【优选算法:双指针】——复写零题解
java·c++·算法·leetcode·数组·双指针·复写零
程序猿编码1 小时前
不用 PyTorch!从零手写 C++ 深度学习框架,自动微分、CUDA、分布式一把搞定
c++·深度学习·大模型推理·自动微分
real_metrix1 小时前
【学习笔记】C/C++ 头文件自包含
c++·c·头文件·自包含
雪落漂泊1 小时前
C++算法 滑动窗口篇(上)
开发语言·c++·算法
像枫一样1 小时前
STM32串口轮询收发实战教程
arm开发·c++·stm32·单片机·嵌入式硬件·fpga开发·51单片机
Soneswy1 小时前
C++基础篇——类与对象(上)
开发语言·c++
张小姐的猫1 小时前
【MySQL】表的约束
android·linux·服务器·数据库·c++·mysql·adb