How can I add an array to a struct property in C? Here you have an example of what I want to accomplish:
#include <stdio.h>
#include <string.h>
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
How can I add the array oldGrades to the property grades of my recently created object?