typedef struct CvScalar { double val[4]; } CvScalar; CvScalar cvScalarAut( double val0, double val1 , double val2 , double val3 ){ CvScalar scalar; scalar.val[0] = val0; scalar.val[1] = val1; scalar.val[2] = val2; scalar.val[3] = val3; return scalar; }
When I call the func like this:
CvScalar test = cvScalarAut( 234,10,45,200); printf(" %f %f %f %f %f \n",test, test.val[0], test.val[1],test.val[2],test.val[3]);
I get:
234,10,45,200,234
Why 'test' correspond to the first array's value and 'test.val[0]' to the second and not the first?
And test.val[3] gives again the first value?





