title: sort function doesnt work, the simulation can not go on
body: <p>I'm trying to make a sort function to sort the order of float value incompatible pointer. and when u run the code, after typing the size of pointed array and input the value, then the running just stopped. I do not know where the problem is, any one can help.
  I already corrected the warning, but still now result for running the code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void sort(const int size, float *input, float *output);
  
  
  int main(void) {
      int a;
  
      float *b=&amp;b1;
  
      float *c=&amp;c1;
      int i, i1;
  
      printf("input the size\n");
      scanf("%d", &amp;a);
       b=(float*)malloc(sizeof(int)*a);
       c=(float*)malloc(sizeof(int)*a);
      for(i=0; i&lt;a ; i++){
          scanf("%f", &amp;b[i]);
  
      }
      for(i1=0; i1&lt;a; i1++){
          c[i1]=b[i1];
          printf("%f\n", c[i1]);
      }
  
      sort(10, b, c);
      free(b);
      free(c);
      return 0;
  }
  
  void sort(const int size, float *input, float *output)
  {
      void swap( float *element1Ptr,  float *element2Ptr);
      int pass;
      int j;
      int i0;
  
      for (pass=0; pass&lt;size-1;pass++)
      {
          for (j=0; j&lt;size-1;j++){
              if(input[j]&gt;input[j+1]){
  
              swap(&amp;input[j], &amp;input[j+1]);
              }
  
          }
      }
  
  
      for (i0=0; i0&lt;size; i0++){
          output[i0]=input[i0];
          printf("%f", output[i0]);
      }
  
  }
  
  void swap( float *element1Ptr,  float *element2Ptr)
  {
  float hold=*element1Ptr;
  *element1Ptr=*element2Ptr;
  *element2Ptr=hold;
  }
  </code></pre>