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.
我收到警告:warning: passing argument 1 of 'quicksort' makes pointer from integer without a cast.
warning: passing argument 1 of 'quicksort' makes pointer from integer without a cast
函数声明如下:void quicksort(int x[], int first, int last)
void quicksort(int x[], int first, int last)
我正在使用调用函数 quicksort(values[noOfNums],0,(noOfNums - 1));
quicksort(values[noOfNums],0,(noOfNums - 1));
不确定这里到底出了什么问题
您将(可能无效)值作为第一个参数传入数组末尾,而不是传入数组本身(作为指针)。
函数调用应该看起来更像:
quicksort(values, 0, noOfNums - 1);