TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: david nugent
date: 1996-04-24 16:22:20
subject: Filename Expansion

FA> I was only suggesting, that to me there is an inconsistency there.

No, no inconsistency. Very few C library functions (if any?) return purely
boolean information. Certainly you can /derive/ boolean information from
it, but the intention is to return as much information as possible. Most
library functions return a specific value to indicate a failure, but other
return codes are often useful to the caller. The fopen() function, for
example, returns a file descriptor, or NULL in an exception or failure
condition. If it returned boolean, you'd only know if the open succeded,
but you'd have no way of accessing the file thus opened.

 FA> After all if an operation was successful, in boolean terms it would be
 FA> TRUE, so functions returning 1 on success and 0 on failure would make
 FA> more sense.

Sometimes it is. Actually, in C++ I quite often use the bool type (which is
a built-in type in that language). When using classes, you can retain
additional state information within the class itself, so the boolean return
is often a convenient way of doing things. Even in C, I've often used FALSE
and TRUE return values where it makes sense.

--- MaltEd/2 1.0.b6
* Origin: Unique Computing Pty Limited (3:632/348)
SEEN-BY: 50/99 78/0 620/243 623/630 632/103 348 360 998 633/371 634/388 396
SEEN-BY: 635/301 502 503 506 544 639/252 711/401 409 410 413 430 808 809 932
SEEN-BY: 711/934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 632/348 635/503 50/99 711/808 809 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™.