Advertisement
Guest User

mapper

a guest
Jan 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<ctype.h>
  3. #include<stdlib.h>
  4.  
  5. char data[300];
  6. char splitdata[];
  7.  
  8. struct tuples
  9. {
  10. int userID;
  11. char action;
  12. char topic[15];
  13. };
  14.  
  15. int main()
  16. {
  17. FILE *fpointer;
  18. fpointer = fopen("inputfile","r+");
  19. char *dt;
  20.  
  21. if(fpointer == NULL)
  22. {
  23. printf("Could not open the file");
  24. return 1;
  25. }
  26.  
  27. struct tuples tuple;
  28. fgets(data,300,fpointer);
  29.  
  30. dt=strtok(&data[1],')');
  31. printf("%s\n",dt);
  32. fclose(fpointer);
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement