nik
Joined: 28 Feb 2007 Posts: 4
|
Posted: Thu Mar 01, 2007 7:57 am Post subject: compare with 0 |
|
|
today when testing D i found out, that i can't compare a reference with 0, i always get a segmentation fault. Please look at this code:
Code: |
import std.stdio;
class Test2
{
int a, b;
}
class Test
{
Test2 test = null;
void foo( )
{
if( test == null ) writefln( "adfsfd" );
}
}
void main( char[][] args )
{
Test test = new Test();
test.foo();
}
|
|
|