Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. /** Inserting value at first index of vector and push the others to the right
  2. * @vector - vector
  3. * @size - vector total size
  4. * @value - value to be added
  5. */
  6. void insertAtFront(int vector[], int size, int value)
  7. {
  8. int aux_1, aux_2 = value;
  9.  
  10. for(int i = 0; i < size; i++)
  11. {
  12. aux_1 = vector[i];
  13.  
  14. vector[i] = aux_2;
  15.  
  16. aux_2 = aux_1;
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement