源码了解情况:
struct s {
int i;
float f
};
const int cnt = 10;
s *source = new s[cnt];
/*... fill source ...*/
int *dest_i = new int[cnt];
float *dest_f = new float[cnt];
for (int x = 0; x < cnt; x++) {
dest_i[x] = source[x].i;
dest_f[x] = source[x].f;
}
那么,问题来了:有没有比用循环遍历数组更快的方法?