title: How can I add an array to a struct property in C?
body: <p>How can I add an array to a struct property in C? Here you have an example of what I want to accomplish:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct {
      char age;
      short number;
      int grades[10];
      char name[80];
      char address[120];
  } Student;
  
  Student s;
  
  s.age = 23;
  s.number = 10;
  strcpy(s.name, "Jon");
  strcpy(s.address, "Doe");
  
  int oldGrades[10] = {1, 8, 2, 2, 4, 9, 9, 8, 4, 1};
  
  s.grades = oldGrades; // Error: expression must be a modifiable lvalue
  </code></pre>
  
  <p>How can I add the array <strong>oldGrades</strong> to the property <strong>grades</strong> of my recently created object?</p>