c++ - 值未打印出来
问题描述
我正在尝试打印这个使用派生函数的函数。
void Dairy::print(void){
cout << setw(20) << right << whoAmI() << setw(15) << right << this->getFat()<< setw(15) << right << this->getDatePurchased.getDay()<< setw(15) << right << this->getExpireDate().getDate() << setw(15) << right << this->getCholesterol() << endl;
}
该错误表明必须调用对非静态成员的引用。错误可能是什么?
解决方案
推荐阅读
- python - 如何在变量中指定数据框的名称(字符串、dict.item)
- bash - Bash 脚本 - 开关
- c# - 在 ASP.Net C# 中的服务器上托管应用程序后,日期函数不起作用
- python - 天真的分类器使用 dict 的键来遍历 df 的列?
- php - 在下面的查询中添加 Custom Guard admin 以获取 Admin ID 值
- javascript - 如何从 Javascript/Google App 脚本中的另一个函数调用数组
- node.js - 如何在 Mongoose 的数组中添加数据?
- regex - 在apache spark中使用rlike时是否可以知道执行了哪个正则表达式
- python - 我们可以使用 Python 录制视频群聊会议电话吗?
- sprite-kit - SpriteKit 节点淡入问题