title: Overlapping Pointers
body: <p>I have a case in which I have a <code>uint64_t*</code>, a <code>char*</code> (6 chars long), and a <code>uint16_t*</code> that point to the addresses <code>x</code>, <code>x+2</code>, and <code>x</code> respectively. So if the char* points to "This i" then the <code>uint16_t*</code> should point to the value <code>0</code> dec, and the <code>uint64_t*</code> should point to the value <code>115, 588, 096, 157, 780</code> dec.</p>
  
  <p>But when I look at these values I am getting 0 dec for the <code>uint64_t</code> I do not understand why this would be. Could someone explain?</p>
  
  <p>Edit (added code):</p>
  
  <pre><code>FILE *file = fopen("/Users/Justin/Desktop/test.txt", "rb");
  uint64_t *window = malloc(8);
  char *buffer = (char*)(window+2);
  uint16_t *data = (uint16_t*)window;
  uint16_t *read = (uint16_t*)(window+6);
  
  fread(buffer, 6, 1, file);
  
  printf("%p\n", window);
  printf("%p\n", buffer);
  printf("%p\n", data);
  printf("%p\n", read);
  printf("%s\n", buffer);
  printf("%llu\n", *window);
  </code></pre>
  
  <p>and the output is:</p>
  
  <pre><code>0x100105440
  0x100105450
  0x100105440
  0x100105470
  This i
  0
  </code></pre>