title: Pointing an array of string inside a void
body: <p>I have a little problem passing a pointer inside a void. This void show only the firts position of the array of struct. When the loop go to second position i get "segmentation fault".I tried to show the array inside the main with the same loop and it works.What's the problem?</p>
  
  <pre><code>typedef struct starr{
      char string[100];
      int occ;
  } starr;
  
  int main(){
      int n;
      starr *array_str;
      //insert n and array_str
      array_str=(starr *)malloc(sizeof(starr)*n);
      view(&amp;array_str,n);
  }
  
  void view(starr *array_str, n){
      int i;
      for(i=0;i&lt;n;i++){
          printf("String %s",array_str[i]-&gt;string);
      }
  }
  </code></pre>