error: void value not ignored as it ought to be c++

  c++

I wrote this quick sort function

void triRapide(int *t,int n){
    int pivot =n/2;
    int t1[n],t2[n];
    if(n<pivot) {for(int i=0;i<n-1;i++){t1[i]=permut(t[i],t[i+1]);}}
    if(n>pivot){ for(int j=pivot*2;j>pivot;j--){t2[j]=permut(t[j],t[j-1]);}}

    int m = n/2;
    int k = n-m;

    int arr[m + n];
    copy(t1, t1 + m, arr);
    copy(t2, t2 + k, arr + m);}

But, I get this error:

   trirapide.cpp: In function ‘void triRapide(int*, int)’:
   trirapide.cpp:27:69: error: void value not ignored as it ought to be
             if(n<pivot) {for(int i=0;i<n-1;i++){t1[i]=permut(t[i],t[i+1]);}}
                                                                         ^
   trirapide.cpp:28:77: error: void value not ignored as it ought to be
             if(n>pivot){ for(int j=pivot*2;j>pivot;j--){t2[j]=permut(t[j],t[j-1]);}}

Source: Windows Questions C++

LEAVE A COMMENT