hello every one
i make a project about linked list and do some functions on the linked list i want to sort the name in the linked list alphabetical i wrote this code but there is something wrong in it anyone can help thanks :)
# include <iostream>
using namespace std;
struct student
{
int id;
char name [40];
int phone;
student *next;
};
void sort()
{
student *temp1;
temp1=new student;
char temp[40]="";
temp1=h;
for(temp1=h;temp1->next!=0;temp1->next)
{
if(strcmp(temp1->name,temp1->next->name)>=0)
{
temp==temp1->name;
temp1->name==temp1->next->name;
temp1->next->name==temp;
}
}