fopen($file,"r"):打开文件 $file:url格式/本地文件(必须有访问权限; “r”:文件访问类型 > 文件读取: fread($file,$length):读取文件 $length:文件指针最多读取length个字节 停止读取:读取了length字节、到达文件末尾(EOF) fg ...
分类:
Web程序 时间:
2017-11-10 23:17:07
阅读次数:
270
/** * 获取文件后缀 * $path 本地存储临时文件路径 * */ private function getFileType($path){ $fp=fopen($path,'r'); $bin = fread($fp, 2); //只读2字节 fclose($fp); $str_info..... ...
分类:
Web程序 时间:
2017-11-10 20:12:40
阅读次数:
204
字符读写函数: fgetc / fputc字符串读写函数:fputs / fgets格式化读写函数:fscanf / fprintf二进制读写函数:fread / fwrite其他相关函数:检测文件结尾函数feof检测文件读写出错函数ferror清除末尾标志和出错标志函数clearerr文件定位的函 ...
分类:
其他好文 时间:
2017-11-05 22:22:18
阅读次数:
191
题目传送门:https://www.luogu.org/problemnew/show/P3939 题外话:写完这题后本地跑了下极限数据,用时1.5s,于是马上用fread+fwrite优化至0.3s,交至OJ,跑了600+ms,好奇地去掉fread和fwrite,居然只跑了700+ms(总感觉哪里 ...
分类:
其他好文 时间:
2017-11-04 23:30:02
阅读次数:
158
const int buffer_max_size=100000; struct quick_in{ char buf[buffer_max_size]; char *ps;char *pe; quick_in(){ ps=buf;pe=buf+1; } inline void innext(){ ... ...
分类:
其他好文 时间:
2017-10-31 17:33:56
阅读次数:
161
常规 --help 列出简单的用法。 -v 命令行的每一个-v将增加反馈信息的级别。 Level 0(缺省值)除启动提示、测试完成和最终结果之外,提供较少信息。 Level 1提供较为详细的测试信息,如逐个发送到Activity的事件。 Level 2提供更加详细的设置信息,如测试中被选中的或未被选 ...
分类:
其他好文 时间:
2017-10-31 12:57:14
阅读次数:
192
传送门 一道最简单的区间dp,然而我还是抄了题解。 ...
分类:
其他好文 时间:
2017-10-28 19:03:44
阅读次数:
131
#include int a,b; char *ch; inline void read(int &x){ x=0;int f=0; while(*ch!='-'&&(*ch'9'))++ch; if(*ch=='-')f=1,++ch; while(*ch>='0'&&*ch<='9')x=(x<... ...
分类:
其他好文 时间:
2017-10-25 23:48:27
阅读次数:
212
Linux系统中提供了系统调用函数open()和close()用于打开和关闭一个存在的文件 int open(const char *pathname,int flags) int open(const char *pathname,int flags,mode_t mode) int open(c ...
分类:
系统相关 时间:
2017-10-25 00:55:40
阅读次数:
283
咳咳咳……好东西 _(:зゝ∠)_ 转自某位大佬 http://www.cnblogs.com/widerg/p/7353866.html C++ Interesting卡常数 作为一名OIer,在Noip中卡(kǎ)常数可以说是必备技巧。在此总结一下我所知卡常数的神奇手法: IO优化 fread ...
分类:
其他好文 时间:
2017-10-17 10:04:41
阅读次数:
212