- 博客(3)
- 收藏
- 关注

原创 C语言如何删除目录
rmdir()函数只能删除空目录,对于非空目录,可以使用如下代码段:static int rm_dir(const char *path){ char dir_name[MAX_FILE_NAME_LEN] = {0}; DIR *dirp; struct dirent *dp; struct stat dir_stat; if (0 != access(path, F_OK)) return 0; if (0 > stat(path, &dir_s
2020-12-23 15:00:57
1546

原创 C语言localtime获取当前时间
#include "stdio.h"#include "time.h"int get_local_time(char *s_tm){ time_t stime; struct tm *stm = NULL; time(&stime); stm = localtime(&stime); if (!stm) { err_set(ERR_ERR...
2020-03-20 16:28:10
863
1

原创 C语言获取文件行数
int _tmain(int argc, _TCHAR* argv[]){ FILE *fp; int flag = 0, file_row = 0, count = 0; if((fp = fopen("C:\\Users\\zzl\\Desktop\\lmclient\\lmonitor.log", "r")) == NULL) return -1; while(!f...
2018-05-11 15:25:40
27130
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人