void alphaout()
{
nodealpha *curr;
nodealpha *curr2;
curr = first;
curr2 = first;
while (curr != NULL)
{
char al1 = curr2 -> alpha;
char al2 = curr -> alpha;
if (al1 < al2)
{
curr2 = curr;
}
std::cout << "ALPHABET : " << curr -> alpha << endl;
curr = curr -> next;
}
}
I have made a simple program where the user inputs each alphabets and then display it in their order regardless of however way the user inputs the alphabets but the problem is that when it diplays the alphabets are in the same order in which the user has given input I cant figure out how to arrange it in a to z way
Aucun commentaire:
Enregistrer un commentaire