Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 27 void* curr_memory_map = file_memory;
- 28 close (fd);
- 29
- 30 for(int i = 0 ; i < num ;i++){
- 31 /* read and print the integer */
- 32 sscanf (curr_memory_map, "%d", &integer);
- 33 printf ("file contains: %d\n", integer);
- 34 int incrementation = sizeof(integer);
- 35
- 36 curr_memory_map +=incrementation;
- 37
- 38 if (curr_memory_map == NULL){ //am I retarded attempt 3
- 39 break;
- 40 }
- 41 // char* curr_value = curr_memory_map; // typecast
- 42
- 43 // if (curr_value == NULL){ //Attempt 1
- 44 // break;
- 45 // }
- 46
- 47 // while(curr_value != NULL){ //Attempt 2
- 48 // printf("%c \n",*curr_value);
- 49 // curr_memory_map +=incrementation;
- 50 // curr_value = curr_memory_map;
- 51 // }
- 52
- 53
- 54 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement