TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bo Simonsen
from: Jasen Betts
date: 2003-09-13 22:00:02
subject: Pointers

Hi Bo.

09-Sep-03 12:58:10, Bo Simonsen wrote to Jasen Betts


 BS> G'day Jasen,

 BS> Sat 2003-09-06 07:49, Jasen Betts (3:640/1042) wrote to Bo
 BS> Simonsen:

 JB>> assuming function(parm) returns 2 ....

 JB>> if(function(parm) == TRUE) puts("2 is not 1: this won't
happen");

 JB>> if(function(parm)) puts("2 is not false: this will happen");

 BS> It means all other than 2 is false? and 2 is true?

no... C treats anything other than 0 as true,  only 0 is false, (NULL too,
but that's usually 0)

 JB>> if("pigs fly") puts("All non-null pointers are
true");

in case that one had you scratching your head "pigs fly" is a constant
character array, and arrays can be treated as pointers, and are never NULL.

 -=> Bye <=-

---
* Origin: Black Holes were created when God divided by zero! (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

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