📄 iofuncs.c
字号:
#include <stdio.h>void write_data_(data,numbytes,file_ptr) long *data; long *numbytes; long *file_ptr;{ fwrite(data,1,*numbytes,(FILE *) *file_ptr);}int read_data_(data,numbytes,file_ptr) long *data; long *numbytes; long *file_ptr;{ return(fread(data,1,*numbytes,(FILE *) *file_ptr));}long open_file_(name, status, namlen) char *name; int *status; int namlen;{ char *tmp; FILE *fp; tmp = (char *) malloc(namlen+1); strncpy(tmp, name, namlen); tmp[namlen] = 0; tmp[strcspn(tmp," \t\r\n")]=0; if (*status == 1) { fp = fopen(tmp,"w"); } else { if (*status == 2) { fp = fopen(tmp,"w+"); } else { fp = fopen(tmp,"r"); } } if (!fp) { perror("Error in open"); } free(tmp); return (long) fp;}void close_file_(fp) int *fp;{ fclose((FILE *) *fp);}void rewind_file_(fp) int *fp;{ rewind((FILE *) *fp);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -