hour11_3b.cpp
来自「《24学时精通c++》的随书源码的下半部分。欢迎下载学习。」· C++ 代码 · 共 23 行
CPP
23 行
//Listing 11.7
// Returning multiple values from a function
// rename to factor.cpp which should be added to the project in the Borland IDE
// ^^^ This second part is *very* important -- it allows the
// compiler and linker to find your code!
#include <iostream>
#include "factor.hpp"
short Factor(int n, int *pSquared, int *pCubed)
{
short Value = 0;
if (n > 20)
Value = 1;
else
{
*pSquared = n*n;
*pCubed = n*n*n;
Value = 0;
}
return Value;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?