www.pudn.com > nanjingdaxue.rar > mmap.c
/* We start by defining a RECORD structure
and then create NRECORDS versions each recording their number.
These are appended to the file records.dat. */
#include
#include
#include
#include
typedef struct {
int integer;
char string[24];
} RECORD;
#define NRECORDS (100)
int main()
{
RECORD record, *mapped;
int i, f;
FILE *fp;
fp = fopen("records.dat","w+");
for(i=0; i