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

📄 rd_rand.c

📁 C和指针非常好的一本书.里面的有许多代码可以借鉴.
💻 C
字号:
/*
** Reads a specific record from a file.  The arguments are the stream
** from which to read, the desired record number, and a pointer to
** the buffer into which the data should be placed.
*/
#include <stdio.h>
#include "studinfo.h"

int
read_random_record( FILE *f, size_t rec_number, StudentInfo *buffer )
{
	fseek( f, (long)rec_number * sizeof( StudentInfo ),
	    SEEK_SET );
	return fread( buffer, sizeof( StudentInfo ), 1, f );
}

⌨️ 快捷键说明

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