c++ structure-array question
Hiya,
Say I had a data structure containing 3 floats, such as:
struct threefloats
{
float x, y, z;
} float3f;
and I had a function which operates on an array of floats, such as:
void foo(float xyz[3]);
Is there anyway that I could modify the threefloats structure so as I could call foo with an argument of type threefloats? I know that I could make it return float by adding:
operator float()
to structure, but what about casting threefloats to an array such that x, y, and z in the threefloats structure gets put into the array for foo() to operate on.
Thanks,
deveraux83
|