home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / std / cplus / 1755 < prev    next >
Encoding:
Text File  |  1992-12-11  |  938 b   |  22 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <1992Dec11.233748.12815@microsoft.com>
  6. Date: 11 Dec 92 23:37:48 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Dec8.103218.27689@lth.se> <9234423.15066@mulga.cs.mu.OZ.AU> <KANZE.92Dec10174617@slsvdnt.us-es.sel.de>
  9. Lines: 11
  10.  
  11. In article <KANZE.92Dec10174617@slsvdnt.us-es.sel.de> kanze@us-es.sel.de (James Kanze) writes:
  12. |    int    cmp = memcmp( &ptr1 , &ptr2 , sizeof( void* ) ) ;
  13. |
  14. |This works on all implementations I can think of.  Is it guaranteed?
  15.  
  16. Also, Cray uses very different pointer implementations for char* verses
  17. other types of pointers, since the natural address granularity on the Cray
  18. is too large to make a good char*.  Thus sizeof(char*) != sizeof(int*) 
  19. for example. [I don't know what sizeof(void*) would compare to -- char*
  20. or int*]
  21.  
  22.