有关引用中函数返回多个值的问题???????????????????????????
#include<iostream.h>int Factor(int, int&, int&);
int main()
{
int number,squared,cubed,error;
cout<<"Enter a number(0 ~ 20):";
cin>>number;
error=Factor(number,squared,cubed);
if(error)
cout<<"Error encountered!\n";
else
{
cout<<"number:"<<number<<endl;
cout<<"squared:"<<squared<<endl;
cout<<"cubed:"<<cubed<<endl;
}
}
int Factor(int n,int& rSquared,int rCubed)
{
if(n>20||n<0)
return 1;
rSquared=n*n;
rCubed=n*n*n;
return 0;
}
VC6.0提示:Linking...
ppp192.obj : error LNK2001: unresolved external symbol "int __cdecl Factor(int,int &,int &)" (?Factor@@YAHHAAH0@Z)
Debug/pp192.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
pp192.exe - 1 error(s), 0 warning(s)
求大神们分析,谢谢?????????????????????