title: Print out elements of an array of strings in c
body: <p>I've created a function that takes a pointer to the first element in a C-String array.
  This is the array, and how I went about making it:</p>
  
  <pre><code>char element1[60] = "ubunz";
  char element2[60] = "uasdasffdnz";
  char* array[10] = {element1,element2};
  </code></pre>
  
  <p>Then I created a pointer to the first element in the array:</p>
  
  <pre><code>char *pointertoarray = &amp;array[0];
  </code></pre>
  
  <p>Then I passed the pointer to the function I made:</p>
  
  <pre><code>void printoutarray(char *pointertoarray){
    int i = 0;
    while (i &lt; 2){
      printf("\n Element is: %s \n", *pointertoarray);
      pointertoarray = pointertoarray + 1;
      i = i+1;
    }
  }
  </code></pre>
  
  <p>When I run the program the array never prints out. </p>
  
  <p>I've done this program before in C++ but I used the STL string type, and made a pointer to an array of strings. I think my problem lies with the way I'm going about making an array of strings in C, and making a pointer to it.</p>