title: Segmentation of memory in the C language
body: <p>I am reading some text about the C language at the url <a href="https://cs.senecac.on.ca/~btp100/pages/content/compu.html" rel="nofollow noreferrer">https://cs.senecac.on.ca/~btp100/pages/content/compu.html</a>. In the section "Segmentation", it says: 
  "One logical technique for managing the addressing of a large number of bytes is segmentation.  Segmentation distinguishes certain regions of memory from other regions.  For example, an operating system stores program information in dedicated segments. "
  <img src="https://i.stack.imgur.com/KmktA.png" alt="enter image description here"></p>
  
  <p>I do not quite get it.</p>
  
  <p>For example, if I have the following program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[])
  {
      int x = 4;
      int y = 5;
      printf("%d\n", x+y);
    system("PAUSE");  
    return 0;
  }
  </code></pre>
  
  <p>So, what is stored in Segment Code, what in Segment Data, and what in Stack? Please.</p>
  
  <p>Thanks a lot</p>