TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Bob Lawrence
from: Paul Edwards
date: 1996-12-08 13:11:30
subject: posix

BL> How? What function will turn the "seconds since 1970" long into
BL> a time string "1-01-70"? 

PE> localtime() followed by strftime(). Assuming a POSIX
PE> environment, where time_t and "seconds since 1970" are presumed
PE> identical. 

BL> Why the FUCK didn't you tell me that in the beginning, instead of
BL> telling me to use strftime()? JEESEZ!

You DO use strftime().  I can't remember what the original question was,
but I'm sure I would have answered it.  If you had asked "how do I get
a "struct tm", all I have is a time_t at the moment", THEN I
would have said localtime().


BL> qsort(list, n, 80, sort);

PE> I didn't say that. You didn't ask me about the qsort call. That
PE> "80" is incorrect. It should be sizeof(char *). 

BL> Sizeof WHAT char* pointer? And anyway, it doesn't work. I've already
BL> tried that.

I don't believe you tried it properly.  sizeof list[0] and in the
comparison function, *(char **).

PE> And xysort works successfully too. BFN. Paul.

BL> Whatever it is... I can't make head nor fucking tail of it.

Do a "help sort", and then try using the sort program (without
any parameters), and then substitute xysort, and then you'll find that
they're just about identical.  The only difference being that xysort is
restricted only to available memory, unlike sort which is 64k (even though
I've got 64 MEG under OS/2, even more virtual memory)!

BL> And don't tell me to just use it blindly. I'm trying to *learn*
BL> something. I already know how to say "Polly wants a cracker."

No, you work out what you're doing, and what it's doing, and look for the
difference.  BFN.  Paul.

P.S. Post a 20-line *complete* program that attempts to sort an array of 10
character pointers and it will be a hell of a lot easier to point out the
bit where you stuffed up.
@EOT:

---
* Origin: X (3:711/934.9)

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