摘要: 1 #include <stdio.h> 2 #include <io_utils.h> 3 #include <time_utils.h> 4 #include <locale.h> 5 6 #define COPY_SUCCESS 0 7 #define COPY_ILLEGAL_ARGUMEN 阅读全文
posted @ 2023-02-12 18:21 泥古拉斯赵四 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <io_utils.h> 3 #include <errno.h> 4 #include <string.h> 5 6 void ReadFile1() { 7 FILE *file = fopen("CMakeLists.txt", 阅读全文
posted @ 2023-02-12 16:05 泥古拉斯赵四 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <io_utils.h> 3 #include <errno.h> 4 #include <string.h> 5 6 #define COPY_SUCCESS 0 7 #define COPY_ILLEGAL_ARGUMENTS -1 阅读全文
posted @ 2023-02-12 15:52 泥古拉斯赵四 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <io_utils.h> 3 #include <errno.h> 4 #include <string.h> 5 6 //void ReadFile() { 7 // FILE *file = fopen("CMakeLists.tx 阅读全文
posted @ 2023-02-12 15:35 泥古拉斯赵四 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 没有缓冲 有了缓冲 创建file变量时,传入的参数: 可以用fflush, 清空缓冲区,让缓冲区内存的数据立刻打印出来。 1 #include <stdio.h> 2 #include <io_utils.h> 3 #include <errno.h> 4 #include <string.h> 5 阅读全文
posted @ 2023-02-12 15:05 泥古拉斯赵四 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 1 #include <io_utils.h> 2 #include <time_utils.h> 3 #include <time.h> 4 5 #define PI 3.1415926 6 7 void DoHardWork() { 8 double sum = 0; 9 for (int i 阅读全文
posted @ 2023-02-12 13:33 泥古拉斯赵四 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 1 #define _XOPEN_SOURCE 2 3 #include <io_utils.h> 4 #include <time_utils.h> 5 #include <time.h> 6 7 int main() { 8 long_time_t current_time_in_ms = Ti 阅读全文
posted @ 2023-02-12 13:24 泥古拉斯赵四 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1 #include <io_utils.h> 2 #include <time_utils.h> 3 #include <time.h> 4 5 int main() { 6 long_time_t current_time_in_ms = TimeInMillisecond(); 7 int c 阅读全文
posted @ 2023-02-12 13:14 泥古拉斯赵四 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 时间戳表示从1970年1月1日到现在的秒数。 1 #include <io_utils.h> 2 #include <time_utils.h> 3 #include <time.h> 4 5 int main() { 6 time_t current_time; 7 time(&current_t 阅读全文
posted @ 2023-02-12 13:06 泥古拉斯赵四 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 头文件定义 1 #ifndef CHAPTER10_INCLUDE_TIME_UTILS_H_ 2 #define CHAPTER10_INCLUDE_TIME_UTILS_H_ 3 4 #if defined(_WIN32) 5 #include <sys/timeb.h> 6 #elif def 阅读全文
posted @ 2023-02-12 12:56 泥古拉斯赵四 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-02-12 12:41 泥古拉斯赵四 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 什么也不设置, 看一下代码运行结果。 1 #include <io_utils.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <wchar.h> 5 #include <wctype.h> 6 #include <locale.h 阅读全文
posted @ 2023-02-12 12:31 泥古拉斯赵四 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #include <io_utils.h> #include <string.h> #include <stdlib.h> int main() { // memchr() // strchr() // memcmp() // strcmp() //memset() char *mem = mall 阅读全文
posted @ 2023-02-12 11:52 泥古拉斯赵四 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1 #include <io_utils.h> 2 #include <string.h> 3 4 int main() { 5 char src[] = "HelloWorld"; 6 char dest[20] = "C said123456"; 7 // strcat(dest, src); 阅读全文
posted @ 2023-02-12 11:37 泥古拉斯赵四 阅读(90) 评论(0) 推荐(0) 编辑