我想在 C++ 中返回多个值,我有这段代码:
struct returns
{
int row_locs, col_locs;
int row_descriptors, col_descriptors;
double **locs;
double **descriptors;
};
void returns (int &row_locs, int &col_locs, int &row_descriptors, int &col_descriptors, double **locs, double **descriptors)
{
//make some changes in variables
}
问题是“什么会消耗更多时间:struct
还是通过引用调用?”