Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct AbbrArray *getAllAbbrsArrayNew(const char *str)
- {
- int size = INITIAL_CAPACITY;
- struct Abbr *array = malloc(size * sizeof(struct Abbr));
- char string[strlen(str)];
- for (int i = 0; i <= strlen(str); i++)
- {
- string[i] = str[i];
- }
- int index = IndexOfAbb(string);
- int counter = 0;
- while (index != -1)
- {
- index = IndexOfAbb(string);
- getAbb(string, array[counter].source, size);
- counter++;
- if (counter > size)
- {
- size *= 2;
- array = realloc(array, size * sizeof(struct Abbr));
- }
- while (isupper(string[index]))
- {
- index++;
- }
- copyOfRange(string, string, strlen(string), index);
- }
- struct AbbrArray *result = malloc(sizeof(struct AbbrArray));
- result->array = array;
- result->size = counter - 1;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement