关于fread
  • 板块学术版
  • 楼主OldVagrant
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/7/1 23:15
  • 上次更新2023/10/27 22:07:14
查看原帖
关于fread
438168
OldVagrant楼主2022/7/1 23:15

rt,有一个问题,就是缓冲区的那个数组开的大小和输入规模有关吗?有关的话如何计算应该开多少?

const int LEN=1048576;
/*char BUF[LEN],*Pin,*Pin_last,PUF[LEN],*Pout=PUF,*Pout_last=PUF+LEN-1;//指BUF和PUF两个数组
#define gc() Pin==Pin_last&&(Pin_last=(Pin=BUF)+fread(BUF,1,LEN,stdin),Pin==Pin_last)?EOF:*Pin++
inline void pc(char x){
	if(Pout==Pout_last) fwrite(PUF,1,Pout-PUF,stdout),Pout=PUF;
	*Pout++=x;
}*/
2022/7/1 23:15
加载中...