SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char* foo(char* s, int *i)
  2. {
  3.     while(*(s + *i) && *(s + *i) == ' ')
  4.         *i = *i + 1;
  5.     char* word = (char*)malloc(sizeof(char) * 256);
  6.     int j = 0;
  7.     while(*(s + *i) && *(s + *i) != ' ')
  8.     {
  9.         *(word + j) = *(s + *i);
  10.         *i = *i + 1;
  11.         j++;
  12.     }
  13.     *(word + j) = '\0';
  14.     return word;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top