Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char** getWords(char* line, size_t amount){
- char** words = new char*[amount]();
- int index_one = -1;
- int counter_words = 1;
- for (size_t i = 0; i < amount; i++)
- {
- if (line[i] == ' '|| line[i] == '.')
- {
- int index_two = i-1;
- for (size_t i = 0; i <counter_words ; i++) {
- for (size_t j = index_one + 1; j < index_two - 1; j++)
- {
- words[i][j] = line[j];
- }
- counter_words++;
- }
- int index_one = i+1;
- }
- }
- return words;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement