void size

orgoton orgoton at mindless.com
Wed May 23 05:57:23 PDT 2007


The program

import std.stdio;
import std.string;

void main ()
{
writefln("Sizeof(void)="~toString(void.sizeof));
}

compiles and outputs "sizeof(void)=1". Is this supposed to happen? I mean, in C, it is an error to request sizeof(void) (compiler fails).


More information about the Digitalmars-d-learn mailing list