title: Read and write to a memory location
body: <p>After doing lot of research in Google, I found this program:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int val;
      char *a = (char*) 0x1000;
      *a = 20;
      val = *a;
      printf(&quot;%d&quot;, val);
  }
  </code></pre>
  <p>But it is throwing a run time error, at <code>*a = 20</code>.</p>
  <p>So how can I write and read a specific memory location?</p>