Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char* foo(char* s, int *i)
- {
- while(*(s + *i) && *(s + *i) == ' ')
- *i = *i + 1;
- char* word = (char*)malloc(sizeof(char) * 256);
- int j = 0;
- while(*(s + *i) && *(s + *i) != ' ')
- {
- *(word + j) = *(s + *i);
- *i = *i + 1;
- j++;
- }
- *(word + j) = '\0';
- return word;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement