title: inline functions in c
body: <p>i have inline c swap function for sorting an array
  but in the compile time it gives error
  that swap reference is undefined.
  by removing the swap it works;
  what is wrong with code</p>
  
  <pre><code>inline void swap(int* a, int* b)
  {
      int temp = *a;
      *a = *b;
      *b = temp;
  }
  
  void sort(int ar[])
  {
      int length = sizeof(ar) / sizeof(int);
      for(int i = 0; i &lt; length; i++)
      {
          for(int j = i; j &lt; length; j++)
          {
              if(ar[j] &lt; ar[i])
              {
                  swap(&amp;ar[j], &amp;ar[i]);
              }
          }
      }
  }
  </code></pre>