Sorting alphabetically
<p>Here is my code...What would be the best way to sort names alphabetically? </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
    int StudentNum;

    cout &lt;&lt; "How many student are in the class?\n";
    cin &gt;&gt; StudentNum;

    string sname[25];
    if (StudentNum &lt; 1 || StudentNum &gt; 25)
    {
    cout &lt;&lt; "Please enter a number between 1-25 and try again\n"; 
    return 0;
    }

    for (int i = 1; i &lt;= StudentNum; i++) 
    {
        cout &lt;&lt; "Please enter the name of student #" &lt;&lt; i &lt;&lt; endl;
        cin &gt;&gt; sname[i];        
    }   
    for (int output = 0; output &lt;=StudentNum; output++)
    {
    cout &lt;&lt; sname[output] &lt;&lt; endl;
    } 
    system ("pause");
    return 0;
}
</code></pre>
