cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

spectral
Adept II

&a->b is equal to &(a->n) ou (&a)->b

Hi,

 

I suspect that sometimes the following expression "&a->b" is evaluated as :

(&a)->b

 

... but it should be &(a->n) ? Right ?

0 Likes
Reply
3 Replies
nou
Exemplar

&a->b is equal to &(a->n) ou (&a)->b

yes -> have higher priority than &

0 Likes
Reply
spectral
Adept II

&a->b is equal to &(a->n) ou (&a)->b

Thanks Nou,

So, my bug is somewhere else !

0 Likes
Reply
eugenek
Journeyman III

&a->b is equal to &(a->n) ou (&a)->b

It is a good practice not to rely on C precedence rules (except the most obvious ones, such as * over +) and to use parentheses whenever there's a possibility of doubt.

0 Likes
Reply