第一题写完辣
This commit is contained in:
@@ -47,3 +47,16 @@ void display(bookList *l) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int getLength(bookList *l) {
|
||||
if (isEmpty(l)) {
|
||||
return 0;
|
||||
}
|
||||
bookNode *temp = (*l)->next;
|
||||
int length = 0;
|
||||
while (temp != NULL) {
|
||||
length++;
|
||||
temp = temp->next;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user