title: Copying contents of an array to a multidimensional array using pointers in C?
body: <pre><code> //Given this snippet of code:
  
      int main() {
          char sample[] = "Hello World";
          char ma[2][6]; 
          char *sptr, *mptr;
  
          return 0; 
      }
  </code></pre>
  
  
  
  <p>I was thinking this through. sptr is the pointer referring to array sample and mptr is the pointer referring to array  ma. Do I first need to reference the pointers to their respective arrays, and     loop through each dimension of the array ma, and increment both of the pointers and set them equal each other? 
   Here is what I have written so far </p>
  
  <pre><code>int main(){
  char sample[] = "Hello World"; // Create an arry of char  to hold the string "Hello World"
  char ma[2][6];    //Create an two dimensional array of char  with 2 rows and  6 columns
  char *sptr, *mptr; // Create two pointer variables of type char that are used to copy the content from array sample into array ma
  char*sptr = sample;
  char*mptr = ma; 
  int row;
  int column;
  
  for (row = 0; row &lt; 2; row++) {
      for (column = 0; column &lt; 6; column++){
          *sptr++ = *mptr++;
      }
  }
  
  
  
  return 0;
  </code></pre>