Guest User

Untitled

a guest
Dec 18th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. int main (int argc, char argv[]) {
  6. FILE *file;
  7. int x, y;
  8. char s[100];
  9. char s1[100];
  10. char *token; //token is a pointer to a char.
  11. char tokenList[20][100];
  12. int NumTokens = 0;
  13.  
  14. file = fopen("biglist2.txt", "r");
  15. while (!feof(file)) {
  16. fgets(s1, 100, file);
  17. //sscanf(s, "%d %d", &x, &y);
  18. printf("%s n <br>", s1);
  19. }
  20. strcpy( s, s1 );
  21. token = strtok(s, " ");
  22. while (token != NULL) {
  23. token = strtok(NULL," ");
  24. printf("%s <br>", token);
  25. }
  26.  
  27. fclose (file);
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment