Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 值未打印出来_C++_Derived Class - Fatal编程技术网

C++ 值未打印出来

C++ 值未打印出来,c++,derived-class,C++,Derived Class,我正在尝试打印这个使用派生函数的函数 void Dairy::print(void){ cout << setw(20) << right << whoAmI() << setw(15) << right << this->getFat()<< setw(15) << right << this->getDatePurchased.getDay()<< se

我正在尝试打印这个使用派生函数的函数

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;
}
void乳制品::打印(void){

如果看不到类定义的其余部分,很难说。也许代码中有我们看不到的bug?请展示足够的信息,我们至少可以重现问题。始终包含完整的错误。猜测一下,
this->getDatePurchased.getDay()
->
this->getDatePurchased().getDay()
。您不需要
此->
。请检查:以改进您的问题。