Dmitry Yu Okunev 2 years ago
parent
commit
f6b9df92e1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      mmap-read.C

+ 3 - 3
mmap-read.C

@@ -46,11 +46,11 @@ int main (int argc, char* const argv[]) {
 	
 	for (int i = 0; i < FILE_LENGTH; i+= 0x4 ) {
 
-		b = file_memory [4];
+		b = *(int *)&file_memory[i];
 
-		printf ("I am hear \n i =  %i \n", &i);
+		printf ("I am hear \n i =  %i \n", i);
 		// scanf (file_memory, "%d", &b);
-		printf ("b = %d \n", &b);
+		printf ("b = %d \n", b);
 	}
 
 	/* Освобождаем память. */