Sort argv in a certain order
<p>I am trying to sort all parameter argv in alphabetical order but I don't understand why my code don't work when I put 3 parameter or more.</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
void swap(int argc, char argv[]);

int main(int argc, char **argv) {
    swap(argc, argv);

    system("PAUSE");
    return 0;
}
void swap(int argc, char argv[]) {
    int i, j;
    char temp;

    for (i = 0; i &lt; argc; i++)
    {
        for (j = 0; j &lt; argc; j++)
        {
            if (strcmp(*(argv + j), *(argv + j + 1)) &gt; 0)
            {
                temp = *(argv + j);
                *(argv + j) = *(argv + j + 1);
                *(argv + j + 1) = temp;
            }
        }
    }
}
</code></pre>