linux C
linux下C相关的编程
GeraldJones
可我不想拯救世界,我只想帮奶奶洗碗。
展开
-
gcc编译 -I -L -l的使用
cc -o hello hello.c -I /home/hello/include -L /home/hello/lib -lworld参数说明:-I /home/hello/include表示将/home/hello/include目录作为第一个寻找头文件的目录,寻找的顺序是:/home/hello/include–>/usr/include–>/usr/local/inclu...转载 2020-02-22 10:21:55 · 265 阅读 · 0 评论 -
C语言时间函数(精确到us)
头文件#include "sys/time.h"全局/局部变量static struct timeval st;static struct timeval ed;static double time_total;函数调用gettimeofday(&st, NULL);gettimeofday(&ed, NULL);time_total = (ed.tv_se...原创 2020-01-02 21:06:22 · 1954 阅读 · 0 评论 -
写文件接口库函数
接口的封装将写文件操作封装到一个接口中:w_file()#include "stdio.h"#include "./file_IO.h"// 写文件操作int w_printf(FILE *fp, char *dat, int dat_num){ unsigned int i, j; if(!fp) { printf("Fopen file error!\n"); r...原创 2020-01-02 20:40:49 · 337 阅读 · 0 评论