Question: How to put a pointer in proc parameter

For example the below is a c code how to write this in maple

 

void swap(int *a, int *b)

 {

     int temp;

emp = *a;

*a = *b;    

 *b = temp;  

}    //permutation function

 void permutation(int *arr, int start, int end)

 {      

if(start==end)

     {        

 printarray(arr, end+1);

         return;    

 }      

int i;    

 for(i=start;i<=end;i++)  

   {          //swapping numbers      

   swap((arr+i), (arr+start));      

   //fixing one first digit          //and calling permutation on          //the rest of the digits          permutation(arr, start+1, end);          swap((arr+i), (arr+start));  

   }  

}

Please Wait...