struct node {
int ID;
char *name; // Points to a dynamically allocated string.
struct node *next;
};

void format_name(struct node *head) {
Struct node *temp = head;
while (temp){
    char *last;
    char *first;
    fscanf(temp->name, "%s", &last);
    fsacnf(temp->name, "%s", &first);
    char *name;
    strcat(name, first);
    strcat(name, "-");
    strcat(name, last);
    strcy(temp->name, name);
    temp = temp->next;
}
return 0;
}
Considering that the name of each linked list node has the form "lastname, firstname", for each
node starting at the specified head, reorder the two names and convert them into the following form:
"firstname-lastname". Write your code so that it does not have a memory leak.