| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Filename Expansion |
27 Apr 96 21:58, Frank Adam wrote to Andrew Clarke:
> No , i was saying that in a boolean test True = 1 and False = 0, so
> the functions returning a 0 on success seem out of sorts, not to mention
> it limiting my ability or desire to test the return value as a bool True.
> Oh, yes i could have: if(!strcmp("bla","bla")) dothat();
> Do we like that ? ;)
I'm not sure I fully understand what you're getting at there Frank. Few
(if any?) standard C library functions return 1 for success and 0 for
failure. That's just the way it is.
I'm not sure how a function returning 0 on success can't be tested in a
boolean expression though.
#include
int myFunc(void)
{
return 0;
}
int main(void)
{
if (myFunc() == 0)
return EXIT_SUCCESS; /* True */
else
return EXIT_FAILURE; /* False */
}
???
Regards
Andrew
--- Msgedsq/2 3.38
* Origin: Blizzard of Ozz, Melbourne, Australia (3:635/727.4{at}fidonet)SEEN-BY: 50/99 78/0 620/243 623/630 632/349 635/503 544 727 637/106 711/401 SEEN-BY: 711/409 410 413 430 808 809 932 934 712/515 713/888 714/906 800/1 SEEN-BY: 7877/2809 @PATH: 635/727 544 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™.