Reply to Tim,
> Hi, I am a D newbie. Why does this program segfault?
>
> import std.stdio;
> import std.c.stdlib;
> class Foo
> {
> public int m_int = 0;
> }
> int
> main(string[] args)
> {
> Foo f;
> printf("foo %d\n", f.m_int);
> return EXIT_SUCCESS;
> }
The default value for any object Reference (f in this case) is null. create
a new object to use (Foo f = new F();)