函数的返回值作为函数的参数使用:
#include <iostream>
int test(int x,int y);
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int x=5,y=6;
//函数的返回值作为函数的参数
cout <<test(y,test(x,y))<<endl;
return 0;
}
int test(int x,int y)
{
return x>y?x:y;
}