Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. void * readFileToList(List * self){
  2.     List  * list = List_new();
  3.     StringBuffer *sb = StringBuffer_new();
  4.    
  5.     const char * input = readFileToBuffer("data.txt", sb, 10000);
  6.     while(input != '\0'){
  7.     if (isdigit(*input))
  8.         {
  9.             StringBuffer_clear(sb);
  10.             while (isdigit(*input))
  11.             {
  12.                 StringBuffer_appendChar(sb, *input);
  13.                 input++;
  14.             }
  15.             List_add(self, sb);
  16.             input--;
  17.         }
  18.         input++;
  19.     }
  20.     return list;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement