求助,在c51的死循环主程序里,调用一个有返回值保存下来吗?

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:13:40
在c51的死循环主程序里,调用一个有返回值的函数,能否把把第一次返回的值给保存下来,再次循环到这个有返回值的函数时,再返回一个值,让两个返回值加在块一起使用呢?
如何能实现呢?

int OldRet=0, flag=0;

main ()
{
while (1)
{
int CurRet=call();
if (flag==0){ OldRet=CurRet;flag=1; }
else {
//now you got 2 result:OldRet and CurRet;
}
}
}

=============
while(1)
{

num = 0 ;
tt=keyscan();//调用有返回值子函数,并把返回来的值赋给temb
if (tt!=0){
temb= (temb % 10 )*10 + (tt-1)%10;
}
//other code
}