delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/21/15:00:27

Message-ID: <3AE1D9D3.AC592F3F@mail.rosecom.ca>
From: April <awhite AT mail DOT rosecom DOT ca>
X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {TLC;RETAIL} (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Printing function pointers
References: <3AE082F7 DOT B4E9C05 AT jps DOT net>
Lines: 28
Date: Sat, 21 Apr 2001 15:04:52 -0400
NNTP-Posting-Host: 205.189.215.28
X-Trace: client 987879497 205.189.215.28 (Sat, 21 Apr 2001 14:58:17 EDT)
NNTP-Posting-Date: Sat, 21 Apr 2001 14:58:17 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I changed your example to include explicit type casts:

#include <iostream>

int junk1() { return 111; }

int junk2() { return 222; }

int main()
{
  if ( junk1 != junk2 ) {
    cout << "different\n";
  }
  cout << ( unsigned long )junk1 << '\n';
  cout << ( unsigned long )junk2 << '\n';
  return 0;
}


and I got:

different
5488
5508

I don't know enough about the C++ standard to explain why though

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019