home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!physik.tu-muenchen.de!berg
- From: berg@physik.tu-muenchen.de (Stephen R. van den Berg)
- Newsgroups: comp.std.c
- Subject: pointer comparisons
- Date: 30 Dec 1992 14:59:20 GMT
- Organization: Rechnerbetrieb Informatik - RWTH Aachen
- Lines: 24
- Message-ID: <1hsdg8INN5jm@urmel.informatik.rwth-aachen.de>
- NNTP-Posting-Host: ikki.informatik.rwth-aachen.de
- Originator: berg@ikki
-
- What about the following program:
- --------------------test.c--------------
- #include <stdio.h>
- #include <stdlib.h>
-
- void*a,*b;
-
- main()
- { int i;
- a=b=0;
- i=a==b; i+=a!=b;
- a=malloc(1); b=malloc(1);
- i+=a>b; i+=a>=b; i+=a<b; i+=a<=b;
- printf("%d\n",i);
- return i;
- }
- ---------------------------------------
-
- Is this program *always* required to print or return "3"?
- --
- Sincerely, berg@pool.informatik.rwth-aachen.de
- Stephen R. van den Berg (AKA BuGless). berg@physik.tu-muenchen.de
-
- "Good moaning!"
-