Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用标准库函数在 C++ 中压缩两个数组(如在 Python 中),那么 Python 的内置函数 zip() 是否有任何等价物?
int **zip(int *arr1, int *arr2, int length) { int **ret = new int*[length]; for(int i = 0; i<length; i++) { ret[i] = new int[2]; ret[i][0] = arr1[i]; ret[i][1] = arr2[i]; } return ret; }