⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tfseek.c

📁 su 的源代码库
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       */#include	"stdtest.h"MAIN(){	FILE	*fp;	int	i, c, e;	if(!(fp = fopen(tstfile(0), "w+")) )		terror("Can't open temp file\n");	for(i = 0; i < 256; ++i)		if(putc(i, fp) < 0)			terror("Bad putc\n");	for(i = 1; i < 255; ++i)	{	if(fseek(fp, (long)(-i), SEEK_END) < 0)			terror("fseek seek_end failed\n");		if((c = getc(fp)) != (e = 256-i) )			terror("Bad getc: expect %d, get %d\n", e, c);		if(fseek(fp, (long)(i), SEEK_SET) < 0)			terror("fseek seek_set failed\n");		if((c = getc(fp)) != i)			terror("Bad getc: expect %d, get %d\n", i, c);		if(fseek(fp, (long)(-1), SEEK_CUR) < 0)			terror("fseek seek_cur failed\n");		if((c = getc(fp)) != i )			terror("Bad getc: expect %d, get %d\n", i, c);	}	TSTEXIT(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -