来自程序的奇怪输出

-4 c++

我编写了以下代码,但输出显示了奇怪的值011512EE.我不知道它来自何处或如何解决它.

码

Mik*_*CAT 5

您正在打印功能的地址.

我想你想调用函数并打印它们的返回值.

试试这个

cout << "\nThe surface area of the prism is: " << calculateSurfaceArea(length, width, height) << endl;
cout << "The volume of the prism is: " << calculateVolume(length, width, height) << endl;
Run Code Online (Sandbox Code Playgroud)

代替

cout << "\nThe surface area of the prism is: " << calculateSurfaceArea << endl;
cout << "The volume of the prism is: " << calculateVolume << endl;
Run Code Online (Sandbox Code Playgroud)