home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!van-bc!tradent!lord
- From: lord@tradent.wimsey.bc.ca (Jason Cooper)
- Newsgroups: comp.lang.c
- Subject: ** HELP WITH FILE I/O **
- Message-ID: <JmeswB1w165w@tradent.wimsey.bc.ca>
- Date: Sat, 02 Jan 93 22:02:18 PST
- Organization: TradeNET International Trade Corp.
- Lines: 26
-
- Eeek! I am writing a program to handle a local track meet and have to
- input the participant records from a file. What I want to do is load
- these into an array for quick and easy access. The array is right now of
- undefined length, and its elements are structures (including each event,
- it's heat, it's event, etc.). I've tried using:
-
- fread(meet[record], sizeof(struct meetstruct), 1, tfile)
-
- Where meet is the array, meetstruct is the structure the array is
- composed of, and tfile is the track meet's file stream. I don't know
- _what_ I'm doing wrong, but if somebody could correct this (oops, forgot
- to mention, that's in a loop to go through records, I tried taking the
- whole thing in one, but that didn't work either), then I'd appreciate
- that VERY MUCH. If I could input the whole thing in one with fread or
- something, that would be _WONDERFUL_. I'm using Borland C++, and would
- like to understand _what_ I'm doing, so if you could explain it too, that
- would be nice. If I have to limit the size of the array, that's doable
- too.
-
- Jason Cooper
-
- Oh, and, since I'm being less-than-coherent, if you think you can help me
- but are not sure, PLEASE send me private mail...
-
- /d
- (oops)
-