Guest User

Untitled

a guest
Nov 16th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. FILE* file = fopen("decode.txt", "r");
  2. 20 char line[128];
  3. 21
  4. 22 int count = 0;
  5. 23 int index = 0;
  6. 24 while(fgets(line, sizeof(line), file) != NULL)
  7. 25 {
  8. 26 if(count == 0)
  9. 27 {
  10. 28 count = atoi(line);
  11. 29 printf("%d\n",count);
  12. 30 }
  13. 31 else if(count != 0)
  14. 32 {
  15. 33 if(index < count)
  16. 34 {
  17. 35 //printf(line);
  18. 36
  19. 37 char character[2];
  20. 38 char* line2 = "hello";
  21. 39 strncpy(character,line, 1);
  22. 40 character[1] = "\0";
  23. 41 //printf(blah);
  24. 42 printf("\n");
  25. 43 printf(character);
  26. 44 printf("%d",strlen(character));
  27. 45 printf("\n");
  28. 46 //int len = strlen("jello");
  29. 47 //printf("%d",len);
  30. 48 //char* code;
  31. 49 //strncpy(code, line+1, strlen(line)-1);
Add Comment
Please, Sign In to add comment