如何对指向int *数组元素的int **数组进行排序

时间:2013-03-16 18:32:17

标签: c++ arrays sorting pointers int

我有2个阵列

int n = 10;
int a[n];
int** t = new int*[n];

然后我将i的{​​{1}}元素指向t的{​​{1}}元素 然后我想只对i数组中的指针进行排序 然后我试着反击它,但它出错了

a

1 个答案:

答案 0 :(得分:4)

如果你在for循环中递减n,它不会遍历整个数组,尝试将它放在for循环之外