byte & byte

Ellery Newcomer ellery-newcomer at utulsa.edu
Fri Oct 29 10:39:27 PDT 2010


On 10/29/2010 10:48 AM, Jesse Phillips wrote:
> Because C code will not behave differently
>

I'm not convinced of this. Proposed counterexample:

// test.d
import std.stdio;
void main(){
   ushort x = 0xffff;
   writefln("%08x", ~x+1u);
}


// test.c
#include <stdio.h>
void main(void){
   unsigned short x = 0xffff;
   printf("%08x", ~x+1u);
}


More information about the Digitalmars-d-learn mailing list