| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | ReadRandom |
KK> If you are going to read through the whole file, though, KK> you might as well save an index to each line and just KK> load the index and choose one at random. Then you only KK> need to load the whole thing one time, thereafter loading KK> only the index. Processing the file to make the lines into KK> fixed length records would make it even faster, since you KK> could get the file size and divide by the size of the KK> record to get the number of lines and then grab one. I agree with you. My code is actually a response to an interview question in the back of Expert C Programming - Deep C Secrets by Peter Van Der Linden. The question is , Give me a random string from a text file. You may make only 1 pass and not store any additional information. I highly recommend this book to anyone interested in C. It is the only C book I've ever seen that can be read in bed. Bruce --- Maximus/2 3.01 --------------- Next conference: FIDO Message Area Next topic: 240 Apogee Games FIDO MESSAGE AREA==> TOPIC: 240 APOGEE GAMES Ref: D5K00000 Date: 05/13/96 From: JOHN MYERS Time: 08:51pm \/To: ED PROPES (Read 15 times) Subj: FidoNet I would like information on obtianing a FidoNet node number. I allready have a BBS and FidoNet software... Someone told me you where the guy to talk to. Please advise... BBS: 920-9939... Voice: 920-9939... oops... the BBS # is :920-9969 --- ---------------* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000) * Origin: The 1995 BBS (1:2215/1995) |
|
| SOURCE: echomail via exec-pc | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.