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.

相关推荐
“αβ”17 分钟前
MySQL表的操作
linux·网络·数据库·c++·网络协议·mysql·https
十五年专注C++开发36 分钟前
Asio2: 一个基于 Boost.Asio 封装的高性能网络编程库
网络·c++·boost·asio·asio2
gcfer38 分钟前
CS144 中的C++知识积累
c++·右值引用·智能指针·optional容器
Bona Sun2 小时前
单片机手搓掌上游戏机(二十)—pico运行doom之编译环境
c语言·c++·单片机·游戏机
Albert Edison2 小时前
【项目设计】C++ 高并发内存池
数据结构·c++·单例模式·哈希算法·高并发
我真不会起名字啊3 小时前
C、C++中的sprintf和stringstream的使用
java·c语言·c++
猿饵块3 小时前
ros2--图像/image
c++
威桑4 小时前
LLVM (Low Level Virtual Machine)全景机制解析
c++·gcc·llvm
一只小bit5 小时前
Qt 快速开始:安装配置并创建简单标签展示
开发语言·前端·c++·qt·cpp
雍凉明月夜6 小时前
c++ 精学笔记记录Ⅰ
开发语言·c++·笔记