title: Assigning C String to a member of a struct through an array of pointers in C
body: <p>I am getting the error "error C2106: '=' : left operand must be l-value" and I cannot figure out how to fix this. </p>
  
  <p>Here is my structure definition:</p>
  
  <pre><code> typedef struct{
      int temperature;
      char city[100];
      }City;
  </code></pre>
  
  <p>Here is where I am getting the error:</p>
  
  <pre><code>    ptrAvgTemps[0]-&gt;city = ptrArray[0]-&gt;city;
  </code></pre>
  
  <p>ptrAvgTemps is an array of pointers to empty City's and ptrArray is another array of pointers to City's and has the data I need to put into the other array.
  (I'm trying to average out the City's temperature and just copy over the city string.)</p>
  
  <p>Here is my function header.</p>
  
  <pre><code>void getAverageTemperatures(City** ptrArray, City** ptrAvgTemps, int numberOfLines, int* numOfCities) 
  </code></pre>
  
  <p>Thank you for your help!</p>