title: sorting strings with bubble sort algorithm
body: <p>This code stores the number of words in an integer variable and the words in a multidimensionnel string then sorts the words alphabetically using a function. The problem I have is in the function call.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  void sort(char*[50],int);
  int main ()
  {
      int i,n=0;
      char s[50][10];
  
      scanf("%d",&amp;n);//scaning the number of words
  
      for(i=0;i&lt;=n;i++)//scaning the words
      gets(s[i]);
  
      sort(s,n);
  
      for(i=0;i&lt;=n;i++)//printing the words sorted
      printf("%s\n",s[i]);
  }
  void sort(char*s[50],int n)
  {
      int i,j,cmp;
      char tmp[1][10];
  
      //bubble sorting of words
      for(i=0; i&lt;n; i++)
          for(j=0; j&lt;n-1; j++)
          {
              cmp=strcmp(s[j],s[j+1]);
  
              if(cmp&gt;0)
              {
                  strcpy(tmp[0],s[j+1]);
                  strcpy(s[j+1],s[j]);
                  strcpy(s[j],tmp[0]);
              }   
          }
  }
  </code></pre>