title: How to swap two rows in a 2 dimensional array
body: <p>To swap two elements in a normal char array, I know this function will work</p>
  <pre><code>void swap(char str[],int i, int j){
      char c=str[i];
      str[i]=str[j];
      str[j]=c;
  }
  </code></pre>
  <p>I tried something similar with a 2 dimensional array, but got this statement &quot;error: assignment to expression with array type&quot;.
  This is the function I tried to use.</p>
  <pre><code>void swap(char name[][31],int i,int j){
      char hold[31];
      hold=name[i];
      name[i]=name[j];
      name[j]=hold;
  }
  </code></pre>
  <p>I'm really new to coding and I'm trying to learn as much on my own before I enter a tertiary institution.</p>
  <p>I am trying to figure out how to write a function to swap two rows in a 2 dimensional array.</p>