Silent1Snow

Untitled

Dec 20th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. void obr()
  2. {
  3.     int len_str = strlen(str_f);
  4.     int len;
  5.     int k_num = 0;
  6.     int new_razm = 0;
  7.     char *help;
  8.     for (int i = 0; i < num_f; i++)
  9.     {
  10.         len = strlen(txt_f[i]);
  11.         rez_f = (char**)realloc(rez_f, sizeof(char*)*(i++));
  12.         for (int j = 0; j < razm_i_f; j++)
  13.         {
  14.             if (i == index_f[razm_i_f])
  15.             {
  16.                 rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*len_str);
  17.                 rez_f[i] = NULL;
  18.                 strcpy(rez_f[i], str_f);
  19.                 i++;
  20.                 rez_f = (char**)realloc(rez_f, sizeof(char*)*(i++));
  21.                 rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*len);
  22.                 rez_f[i] = NULL;
  23.                 strcpy(rez_f[i], txt_f[i--]);
  24.             }
  25.             else
  26.             {
  27.                 int r_word = 0;
  28.                 {
  29.                     for (int k = 0; k < len && (r_word != 1); k++)
  30.                     {
  31.                         for (int j = 0; j < r_len; j++)
  32.                         {
  33.                             if (str[i][k] != razd_f[j] && f == 1)
  34.                             {
  35.                                 f = 1;
  36.                             }
  37.                             else
  38.                             {
  39.                                 f = 0;
  40.                             }
  41.                         }
  42.                         if (f == 1)
  43.                         {
  44.                             r_word++;
  45.                             k_num = i;
  46.                         }
  47.                     }
  48.                 }
  49.                 if (r_word == 1)
  50.                 {
  51.                     new_razm = len - k_num;
  52.                     help = (char*)realloc(help,sizeof(char)*new_razm);
  53.                     help = NULL;
  54.                     for (int k = k_num; k < len; k++)
  55.                     {
  56.                         int h = 0;
  57.                         help[h] = txt[i][k];
  58.                         h++;
  59.                     }
  60.                 }
  61.                 rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*new_razm);
  62.                 rez_f[i] = NULL;
  63.                 strcpy(rez_f[i],help);
  64.             }
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment