DEV Community

loading...

Discussion on: Make sense of pointers

jmau111 profile image
Julien Maury Author

I'm trying to use explicit things and you give me examples of "implicit" declarations, which is kinda confusing and pretty much my point. b would not have the type you might expect, you get int here. I dit not use that in the article.

I prefer splitting declarations than inlining with commas. Not saying it's the best practice, but it's less confusing, at least for me.

Thread Thread
pentacular profile image
pentacular

What's implicit about those declarations?

My point is that because "int* a, b;" has that kind of confusing behavior, it's odd to claim that you chose it because it is the least confusing syntax.

There are many good arguments for it, but least confusing doesn't seem to be one of them. :)

Thread Thread
jmau111 profile image
Julien Maury Author

it's not what I've said. I'm not inlining declarations like you. I respect your opinion, but I disagree with you here. Anyway, thanks for pointing that :) I will see if, in practice, it's handier or not, smarter or not.

Thread Thread
pentacular profile image
pentacular

By all means. :)

Forem Open with the Forem app