title: Struct members are not updating through pointer to struct
body: <p>I am struggling to understand pointers to structs, so I wrote a sample code with a few print statements.</p>
  
  <pre><code>struct Student {
        uint32_t id;
        uint8_t marks[8];
        int32_t credit;
  };
  
  struct Student jacob;
  struct Student *adam = &amp;jacob;
  struct Student mary = *adam;
  mary.marks[3] = 80;
  jacob.marks[3] = 75;
  adam-&gt;marks[3] = 67;  
  
  printf("jacob: %d\n", jacob);
  printf("&amp;jacob: %d\n", &amp;jacob);
  printf("adam: %d\n", adam);
  printf("*adam: %d\n", *adam);
  printf("mary: %d\n", mary);
  printf("mary.marks[3]: %d\n", mary.marks[3]);
  </code></pre>
  
  <p>The output is: </p>
  
  <pre><code>jacob: 4195856
  &amp;jacob: -436012784 
  adam: -436012784
  *adam: 4195856
  mary: 4195856 
  mary.marks[3]: 80
  </code></pre>
  
  <p>Why is the value of <code>mary.marks[3]</code> 80? From what I understand, <code>mary</code> is indirectly pointing to <code>struct jacob</code> since <code>adam</code> is pointing to the address of <code>jacob</code>. So the line <code>adam-&gt;marks[3] = 67</code> would change the value of <code>mary.marks[3]</code> since they are pointing to the same location.  </p>
  
  <p>Could someone please help me understand why the value of <code>mary.marks[3]</code> remains the same? </p>