www.digitalmars.com         C & C++   DMDScript  

D - access violation

reply Fabian <Fabian_member pathlink.com> writes:
okay i get an error when trying to call a class method?!

class Node
{
//char[] value;
//Node* childen[10];

void Create( int depth, int curDepth )
{
//if( curDepth >= depth )
//	return;

//for( int i = 0; i < childen.length; i++ )
//{
//printf("hello!\n");
//children[i] = new Node();
//children[i].Create(depth, curDepth - 1 );
//}
}
}

int main( char[][] args )
{
Node root;
root.Create( 10, 0 );	

return true;
}

am i doing something wrong?
Apr 20 2004
parent J Anderson <REMOVEanderson badmama.com.au> writes:
Fabian wrote:

okay i get an error when trying to call a class method?!

class Node
{
//char[] value;
//Node* childen[10];

void Create( int depth, int curDepth )
{
//if( curDepth >= depth )
//	return;

//for( int i = 0; i < childen.length; i++ )
//{
//printf("hello!\n");
//children[i] = new Node();
//children[i].Create(depth, curDepth - 1 );
//}
}
}

int main( char[][] args )
{
Node root; //error
  
root = new Node;
root.Create( 10, 0 );	

return true;
}

am i doing something wrong?

  
-- -Anderson: http://badmama.com.au/~anderson/
Apr 20 2004