C实现计算某个目录下的普通文件个数
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <dirent.h>#include <sys/types.h>int get_file_num(char* root){ int total = 0; DIR* dir = NULL; // 打开目录 dir = opendir