摘要: 1 //读写结构体 2 #include 3 typedef struct student 4 { 5 int num; 6 char name[30]; 7 char sex; 8 float math; 9 float english; 10 float chinese; 11 12 }Stu; ... 阅读全文
posted @ 2018-08-15 16:32 2018年8月10日注册 阅读(3854) 评论(0) 推荐(0) 编辑
摘要: //使用fread()/fwrite()实现对文件的加密与解密 /* 程序使用方法: 加密用法-> 程序名 -c src dest 解密用法-> 程序名 -d src dest argv[0] argv[1] argv[2] argv[3] */ #define F_PRINT_ERR(e)\ do\ {\ if(... 阅读全文
posted @ 2018-08-15 15:27 2018年8月10日注册 阅读(366) 评论(0) 推荐(0) 编辑
摘要: text.txt文件的内容如下:每一行只有一个等号,且没有空行。——————————————————————a = 3 b = 4c = 90 d= 20e = 25 f =73 g=89——————————————————————text2.txt文件的内容如下:每行可能有多个等号,且会有空行。— 阅读全文
posted @ 2018-08-15 14:11 2018年8月10日注册 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 1 #define F_PRINT_ERR(e)\ 2 do\ 3 {\ 4 if(e == NULL)\ 5 {\ 6 printf("open error");\ 7 exit(-1);\ 8 }\ 9 }\ 10 while(0) 11 int main(void) 12 { 13 FILE *pf = fopen(... 阅读全文
posted @ 2018-08-15 12:37 2018年8月10日注册 阅读(317) 评论(0) 推荐(0) 编辑