Error: functions cannot return static array float[4u][4u]

Spacen Jasset spacen at yahoo.co.uk
Mon Feb 25 13:33:27 PST 2008


The only way I've found to do this sort of thing without wrapping is via 
a pointer:


/* matrix is a static, or class member */
float[4][4] * toFloatArray4x4()
{
	return &matrix;
}


Used:

float v[4][4] = *m1.toFloatArray4x4();

I tried also concocting a system whereby I would return a float[][] 
object, but it doesn't seem easy to prepare such an object from a static 
array.


I feel that multi-dimensional array workings are a bit unintuitive.


More information about the Digitalmars-d-learn mailing list