sll_cnt.c
来自「与C语言四书五经之《C和指针》的配套的书上源代码。」· C语言 代码 · 共 19 行
C
19 行
/*
** Count the number of nodes on a singly linked list.
*/
#include "singly_linked_list_node.h"
#include <stdio.h>
int
sll_count_nodes( struct NODE *first )
{
int count;
for( count = 0; first != NULL; first = first->link ){
count += 1;
}
return count;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?