Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- typedef unsigned char byte;
- #define SIZE 100
- char** mix_word(const char *word)
- {
- int length = strlen(word);
- char **list = malloc(sizeof(char*) * length);
- char s;
- for (int j = 0; j < length - 1; j++)
- {
- list[j] = malloc(sizeof(char)* (length + 1));
- strcpy(list[j], word);
- s = list[j][j];
- list[j][j] = list[j][j + 1];
- list[j][j + 1] = s;
- }
- list[length - 1] = NULL;
- return list;
- }
- char del_word(char *word)
- {
- return word;
- }
- int main()
- {
- char ** result = mix_word("lenght");
- int i = 0;
- while(result[i] != NULL)
- {
- printf("%s\n", result[i]);
- free(result[i++]);
- }
- free(result);
- printf("\n");
- //del_word(word);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement