home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / c / 3289 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1000 b   |  36 lines

  1. Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!physik.tu-muenchen.de!berg
  2. From: berg@physik.tu-muenchen.de (Stephen R. van den Berg)
  3. Newsgroups: comp.std.c
  4. Subject: pointer comparisons
  5. Date: 30 Dec 1992 14:59:20 GMT
  6. Organization: Rechnerbetrieb Informatik - RWTH Aachen
  7. Lines: 24
  8. Message-ID: <1hsdg8INN5jm@urmel.informatik.rwth-aachen.de>
  9. NNTP-Posting-Host: ikki.informatik.rwth-aachen.de
  10. Originator: berg@ikki
  11.  
  12. What about the following program:
  13. --------------------test.c--------------
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16.  
  17. void*a,*b;
  18.  
  19. main()
  20. { int i;
  21.   a=b=0;
  22.   i=a==b; i+=a!=b;
  23.   a=malloc(1); b=malloc(1);
  24.   i+=a>b; i+=a>=b; i+=a<b; i+=a<=b;
  25.   printf("%d\n",i);
  26.   return i;
  27. }
  28. ---------------------------------------
  29.  
  30. Is this program *always* required to print or return "3"?
  31. -- 
  32. Sincerely,                                  berg@pool.informatik.rwth-aachen.de
  33.            Stephen R. van den Berg (AKA BuGless).    berg@physik.tu-muenchen.de
  34.  
  35. "Good moaning!"
  36.