Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. 27 void* curr_memory_map = file_memory;
  2. 28 close (fd);
  3. 29
  4. 30 for(int i = 0 ; i < num ;i++){
  5. 31 /* read and print the integer */
  6. 32 sscanf (curr_memory_map, "%d", &integer);
  7. 33 printf ("file contains: %d\n", integer);
  8. 34 int incrementation = sizeof(integer);
  9. 35
  10. 36 curr_memory_map +=incrementation;
  11. 37
  12. 38 if (curr_memory_map == NULL){ //am I retarded attempt 3
  13. 39 break;
  14. 40 }
  15. 41 // char* curr_value = curr_memory_map; // typecast
  16. 42
  17. 43 // if (curr_value == NULL){ //Attempt 1
  18. 44 // break;
  19. 45 // }
  20. 46
  21. 47 // while(curr_value != NULL){ //Attempt 2
  22. 48 // printf("%c \n",*curr_value);
  23. 49 // curr_memory_map +=incrementation;
  24. 50 // curr_value = curr_memory_map;
  25. 51 // }
  26. 52
  27. 53
  28. 54 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement