SHARE
TWEET

insert_string

daniil_mironoff May 13th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Вставляем элемент (сдвигая)
  2. void insert_string(char ** name, char ** birthday, char ** city, int i, int j) {
  3.     char * str_name = new char[1];
  4.     char * str_birthday = new char[1];
  5.     char * str_city = new char[1];
  6.  
  7.     str_name = name[i];
  8.     str_birthday = birthday[i];
  9.     str_city = city[i];
  10.  
  11.     for (int k = i; j < k; k--) {
  12.         name[k] = name[k-1];
  13.         birthday[k] = birthday[k-1];
  14.         city[k] = city[k-1];
  15.     }
  16.  
  17.     name[j] = str_name;
  18.     birthday[j] = str_birthday;
  19.     city[j] = str_city;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top