我有一个作业,其中包含结构节点,并且在其中一个功能中,其编写顺序为current-> next-> Firstname,我的问题是:current-> next-> Firstname的数据类型是什么?谢谢。代码的相关部分如下:
typedef struct node
{
char Lastname[50];
char Firstname[50];
char Initials[50];
char Mobile[50];
char Class[50];
char InitialSort[50];
char RandomSort[50];
struct node *next;
} node;
node *HEAD=NULL;
// more code here.
void sortedInsert(node** head_ref,node* new_node)
{
node* current;
// Special case for the head end
if (*head_ref == NULL || (*head_ref)->Firstname >= new_node->Firstname)
{
new_node->next = *head_ref;
*head_ref = new_node;
}
else
{
// Locate the node before the point of insertion
current = *head_ref;
while (current->next!=NULL && strcmp(current->next->Firstname, new_node->Firstname)<0 )
{
current = current->next;
}
new_node->next = current->next;
current->next = new_node;
}
}