摘要: 1 if(access(filename, 0)) //to judge the file whether exists,when it's valid, return 0 2 return -1; 3 FILE *f=fopen(filename,"rb"); 4 fseek(f,0,SEEK_E 阅读全文
posted @ 2021-07-09 11:17 `Konoha 阅读(140) 评论(0) 推荐(1) 编辑
摘要: #define定义函数和自定义函数各方面比较 代码长度 #define宏:每次使用时,宏代码都被插入到程序中。除了非常小的宏之外,程序的长度将大幅度增长 函数:函数代码只出现于一个地方:每次使用这个函数时,都调用那个地方的同一份代码 执行速度 #define宏:更快 函数: 存在函数调用、返回的额外 阅读全文
posted @ 2021-07-09 09:26 `Konoha 阅读(525) 评论(0) 推荐(1) 编辑