title: Where does malloc and global variable declaration allocates their variable to in C?
body: <p>In a simple C program, if I <code>malloc</code> a point that points to a variable or array, where is this part of memory allocated to in terms of memory map? I am very new to computer programming, so I am not sure how different variables are stored differently in the memory.</p>
  
  <p>Also, where would a global variable (e.g. <code>int x = 5</code>) be stored to in the memory?</p>
  
  <p>Lastly, is there any material that talks about how C language interacts with the low level hardware? What I found online are all related to C syntax, but I am too noob to read compiler books.</p>
  
  <p>Please let me know if this is not clear.</p>