-4
我要实现以下类型的功能如何从用户定义的C函数返回多个值?
这仅仅是我的问题的更好的诠释
return_type function()
{
return value_1;
return value_2;
};
我要实现以下类型的功能如何从用户定义的C函数返回多个值?
这仅仅是我的问题的更好的诠释
return_type function()
{
return value_1;
return value_2;
};
#include <stdio.h>
typedef struct {
int a,b;
}ret;
ret func(){
ret t; t.a=1; t.b=2;
return t;
}
int main() {
ret test=func();
printf("%d\t%d\n",test.a, test.b);
return 0;
}