Hi, I would like to use the pointer to a float4 like this :
float4 f;float4* pt = &f;
pt->x = 1.f;
But I got a compilation error !!
Originally posted by: viewon01 Hi, I would like to use the pointer to a float4 like this : float4 f; float4 pt; pt->x = 1.f; But I got a compilation error !!
float4 f; float4 pt;
pt is not a pointer. Try pt.x.
Jeff
Sorry, I have corrected the example !
You are not allowed to use operator ->, I reckon. Just substitute it with (*pt).x = 1.f;
Originally posted by: karbous You are not allowed to use operator ->, I reckon. Just substitute it with (*pt).x = 1.f;
This is correct. float4 is not a struct, it's a special vector type. Thus, p->x doesn't make sense.