title: Swapping an array of structs' element with another element
body: <p>I'm trying to swap an array of structs, and I thought following a similar fashion of storing in a temp would work like this:</p>
  
  <pre><code>int temp ,a, b;
  temp = a;
  a = b;
  b = temp;
  </code></pre>
  
  <p>My array of struct definition is this: </p>
  
  <pre><code>struct storage data[10];
  </code></pre>
  
  <p>My attempt to swap an array of structs, I tried this:</p>
  
  <pre><code>struct storage temp[1];
  temp = data[1];
  data[1] = data[2];
  data[2] = temp;
  </code></pre>
  
  <p>Unfortunately, it doesn't compile</p>
  
  <p>My errors are below:</p>
  
  <p>error #2168: Operands of '=' have incompatible types 'struct storage[1]' and 'struct storage'.</p>
  
  <p>error #2088: Lvalue required.</p>
  
  <p>error #2168: Operands of '=' have incompatible types 'struct storage' and 'struct storage*'. </p>