Is this code valid? Yes, but thatโs not what you asked.
Is this code acceptable? It depends (acceptable to anyone?).
I would not find this acceptable - I would find it "harder to read than necessary" for several reasons.
First; many programmers must work with several different languages, potentially with different operator precedence rules. If your code looks like it relies on certain rules of a language operatorโs priority (even if itโs not), then people should stop and try to remember what rules apply to that language.
Secondly; different programmers have different skill levels. If you ever work in a large development team, you will find that the best programmers write code that everyone can understand, and the worst programmers write code that contains subtle errors that half the team cannot detect. Most C programmers should understand " *++*argv ", but a good programmer knows that a small number of "not very good" programmers will either not understand or take some time to figure this out.
Thirdly; Of all the different ways of writing something, you must choose the option that best reflects your intention. For this code, you are working with an array, and therefore it should look like you are going to work with an array (and not with a pointer). Note. For the same reason, " uint32_t foo = 0x00000002; " is better than " uint32_t foo = 0x02; ".
source share