Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void obr()
- {
- int len_str = strlen(str_f);
- int len;
- int k_num = 0;
- int new_razm = 0;
- char *help;
- for (int i = 0; i < num_f; i++)
- {
- len = strlen(txt_f[i]);
- rez_f = (char**)realloc(rez_f, sizeof(char*)*(i++));
- for (int j = 0; j < razm_i_f; j++)
- {
- if (i == index_f[razm_i_f])
- {
- rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*len_str);
- rez_f[i] = NULL;
- strcpy(rez_f[i], str_f);
- i++;
- rez_f = (char**)realloc(rez_f, sizeof(char*)*(i++));
- rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*len);
- rez_f[i] = NULL;
- strcpy(rez_f[i], txt_f[i--]);
- }
- else
- {
- int r_word = 0;
- {
- for (int k = 0; k < len && (r_word != 1); k++)
- {
- for (int j = 0; j < r_len; j++)
- {
- if (str[i][k] != razd_f[j] && f == 1)
- {
- f = 1;
- }
- else
- {
- f = 0;
- }
- }
- if (f == 1)
- {
- r_word++;
- k_num = i;
- }
- }
- }
- if (r_word == 1)
- {
- new_razm = len - k_num;
- help = (char*)realloc(help,sizeof(char)*new_razm);
- help = NULL;
- for (int k = k_num; k < len; k++)
- {
- int h = 0;
- help[h] = txt[i][k];
- h++;
- }
- }
- rez_f[i] = (char*)realloc(rez_f[i], sizeof(char)*new_razm);
- rez_f[i] = NULL;
- strcpy(rez_f[i],help);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment