char *pointers_on_words[20]; char str[]= "First Second Third"; string_split(str,pointers_on_words); int string_split(char* string,char * array_results){ static int word_count; if( *string == '\0'){ int k= word_count; word_count =0; return k+1; }//конец строки if( *(string-1) == '\0'){// если предыдущий символ \0 - значит началось новое слово *array_results = string;//запись адреса нового слова array_results++; word_count++; } if(*string == ' '){//заменяем пробелы на \0 *string = '\0'; } return string_split(string+1,array_results); } The result of this function should be a string broken into words separated by a \ 0 -character. And an array of pointers array_results, in which there should be pointers to the beginning of these very words.
But an error occurs when writing the address to the array of pointers.