title: SELECTION SORT USING POINTERS AND FUNCTIONS IN C
body: <pre><code>#include&lt;stdio.h&gt;
  void functt(int *,int );
  int main {
  int n;
  scanf("%d",&amp;n);
  printf("Enter the elements of the array");
  int i;
  int arr[n];
  int *ptr;
  ptr=arr;
  for (i=0;i&lt;n;i++)
  {
      scanf("%d",(p+i));
  }
  printf("The array elemets are as follows");
  for (i=0;i&lt;n;i++)
  {
      printf("%d",*(p+i));
  }
  void functt(arr,n);
  return 0;
  }
  
  void functt(int *,int n)
  {
      int i,j,min;
      for (i=0;i&lt;n;i++)
      {
          min=i;
  
          for (j=i+1;j&lt;n;j++)
          {
              if(*(p+min)&gt;*(p+j))
              {
                  min=j;
              }
  
          }
      int temp=*(p+min);
      *(p+min)=*(p+j);
      *(p+j)=temp;
  }
  </code></pre>
  
  <p>ERRORS:
  <a href="https://i.stack.imgur.com/T2iLq.png" rel="nofollow noreferrer"> https://i.stack.imgur.com/T2iLq.png</a></p>
  
  <p>Can't run this code due to these errors
  PROGRAM IS TO USE SELECTION SORT VIA POINTERS AND FUNCTIONS.
  LOGIC SEEMS TO BE CORRECT I THINK BUT IT GIVES SOME ERRORS AS IN THE PNG ATTACHED ABOVE.</p>