🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2929

pointer comparisons

#2929
From: Stephen R. van den Berg
Date: Wed, 30 Dec 1992 14:59
24 lines
1035 bytes
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!"
Technical Details
Message-ID: <1hsdg8INN5jm@urmel.informatik.rwth-aachen.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!physik.tu-muenchen.de!berg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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