title: How to write a macro to access data from memory in C?
body: <p>Last week I had an interview. I was asked to write a macro to read a memory location (say <code>0x2000</code>).
  I wrote the code in normal programming, but I could not write the macro.<br>
  Please help me figure out how to write the macro for the code below:</p>
  
  <pre><code>char *address = (char*)0x2000; // address is a pointer to address 3000 char val
  
  *address = 36; // write 36 to 8 bit location at address
  
  val = *address; // read 8 bit value from address
  </code></pre>