TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Paul Edwards
from: Bob Lawrence
date: 1996-11-01 07:53:16
subject: Special Requests

PE> ??? There are a swag of ways of doing that. Besides harcoding
 PE> remove() and rename(), you could use tmpnam() or tmpfile()
 PE> rather than hardcoding a name, and then rather than hardcode
 PE> temp.20, you could take it as a parameter too. 

  remove()! I'd forgotten that C calls its functions funny names, but
I should have remembered *tmpfile() because I actually used it once.
That makes it easy, then.

 PE> I don't think you can even make a statement that 512 is enough.
 PE> I'm sure that will bite me in the bum one day. The current
 PE> utility works as is, but if you want to add remove() and
 PE> rename(), that is fine too.

  Yair... it's not a good compromise and it's no faster anyway. What
I really wanted to do was write a string array in C. In Pascal, I can
declare the array upfront as:

  names:    array[0..128] of string[12];

  but I could find any way of doing that in C. There *must* be a way;
I just couldn't find it because everyone wants to use pointers and
put the actual memory on the heap. So I did it that way.

  Which reminds me... I forgot to limit the names array. Pacal does it
for you with a range check; in C it just overflows. Bum!

Regards,
Bob

___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 711/934 712/610
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

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™.