N
news.tiscali.dk
This might be a really simple question, but here goes: How can I pass an
array to a function and have the function put values into that array? Some
code to clearify (mat is a matrix class)
float m[16];
mat = matX * matZ * matT;
mat.getElements( m );
Render.setMeshTransform( m );
In my matrix class I have
void getElements( TYPE tMatrix[] ) {
tMatrix = m_tElements;
}
float m_tElements[16];
This, of course, works one way; getElements can access the values in
tMatrix. But when the function returns, m is not filled with the values from
m_tElements. So, is it possible to somehow pass an array by reference,
(without new'ing it!)?
array to a function and have the function put values into that array? Some
code to clearify (mat is a matrix class)
float m[16];
mat = matX * matZ * matT;
mat.getElements( m );
Render.setMeshTransform( m );
In my matrix class I have
void getElements( TYPE tMatrix[] ) {
tMatrix = m_tElements;
}
float m_tElements[16];
This, of course, works one way; getElements can access the values in
tMatrix. But when the function returns, m is not filled with the values from
m_tElements. So, is it possible to somehow pass an array by reference,
(without new'ing it!)?