| ▲ | nitrix 3 days ago | |||||||||||||||||||||||||
That is correct.
Using x, or dereferencing p, or subscripting the array arr, or declaring a function that can be called with fn, or dereferencing the function pointer pfn then calling it, all these things would produce an int.It's the intended way to read/write declarations/expressions. As a consequence, asterisks ends up placed near the identifiers. The confused ones will think it's a stylistic choice and won't understand any of this. | ||||||||||||||||||||||||||
| ▲ | pwdisswordfishy 3 days ago | parent | next [-] | |||||||||||||||||||||||||
Blame Stroustrup. | ||||||||||||||||||||||||||
| ▲ | saagarjha 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
Of course, the correct way to use a function pointer is to call it. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | any1 3 days ago | parent | prev [-] | |||||||||||||||||||||||||
> It's the intended way to read/write declarations/expressions. As a consequence, asterisks ends up placed near the identifiers. You know you don't always have to use things as they were intended? > The confused ones will think it's a stylistic choice and won't understand any of this. Well, I've written it both ways, and the compiler never seems to mind. :) Maybe I should start putting space on both sides of the asterisk; seems like it would be a good way to annoy even more people. | ||||||||||||||||||||||||||