Pascal Language - Shift array of elements (Rotation)-Recursion

Ask a question






Here is a recursive procedure which allows to shift all the elements of an array to the right from the position p.


Procedure Shift (Var t : Tab; p, n : integer); 
Begin 
     If p <= n Then 
     Begin 
          Decaler (t, p + 1, n); 
          t[p + 1] := t[p]; 
     End; 
End;


Thanks to Zouari Lazhar for this tip.

VBA/VB6 - My Documents + Environment Variables
Pascal Language - Inverting the elements of an array- recursion