TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jerry Coffin
from: Jasen Betts
date: 2003-09-09 18:14:54
subject: Re: Pointers

Hi Jerry.

08-Sep-03 09:15:41, Jerry Coffin wrote to you

 JC> This is NOT the case with the macro itself though -- it _has_ the
 JC> value 0 to start with. The only tricky part is if it's 0 cast to
 JC> pointer to void; in that case, even though we know it has the
 JC> value 0, it could be impossible to actually retrieve that value
 JC> (though somehow this starts to remind me of the old question of
 JC> whether a tree falling in the forest makes any sound if there's
 JC> nobody there to hear it). Later, Jerry.

In DOS tiny memory model (or near pointers).  NULL is DS:0  (or cs:0 for
function pointers)

#include 
main(){
 void far*  fp=NULL;
 void near* np=NULL;

 printf("Fp=NULL fp: %Fp\n",fp);
 printf("np=NULL np:      %Np\n",np);
 fp=np;
 printf("fp=np   np: %Fp\n",fp);
 }


Fp=NULL fp: 0000:0000
np=NULL np:      0000
fp=np   np: 2C2C:0000


 -=> Bye <=-

---
* Origin: Don't pay your exorcist & get repossessed! (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™.