Error when assigning new string value to char array : <p>When trying to assign a new string value to an existing char array in c, I get the following error:</p>

<pre><code>assignment to expression with array type
  employees[id].FirstMiddleName = NewFirstMiddleName;
                            ^                        
</code></pre>

<p>I thought both variables were arrays of the same size so I don't understand what the error is referring to or how to fix it.</p>

<pre><code>struct employee {
    char LastName[30];
    char FirstMiddleName[35];
    float Salary;
    int YearHired;
};

int modify(int id) {
    char NewLastName[30];
    char NewFirstMiddleName[35];
    float NewSalary;
    int NewYearHired;

    printf("Enter new first (and middle) name(s): \n");
    gets(NewFirstMiddleName);
    employees[id].FirstMiddleName = NewFirstMiddleName;

    printf("Enter new last name: \n");
    gets(NewLastName);
    employees[id].LastName = NewLastName;
    ....

}

int main() {

    struct employee *ptr, person;
    ptr = &amp;person;

    ptr-&gt;LastName[0] = '\0';
    ptr-&gt;FirstMiddleName[0] = '\0';
    ptr-&gt;Salary = -1;
    ptr-&gt;YearHired = -1;

    for(int i = 0; i &lt; 20; i++) {
            employees[i] = person;
            //printf("%i\n", i);
    }
    ....
}
</code></pre>
