DEV Community

[Comment from a deleted post]
Collapse
 
vlasales profile image
Vlastimil Pospichal

Typography:

int* pointer = &number;
Enter fullscreen mode Exit fullscreen mode

or

int *pointer = &number;
Enter fullscreen mode Exit fullscreen mode

?

Collapse
 
po0q profile image
pO0q 🦄 • Edited

there is no typo in the article, I always use the most portable and less confusing syntax ;)
so, to me, the first one

Collapse
 
pentacular profile image
pentacular

So, what does this declare? :)

int* a, b;
 
Sloan, the sloth mascot
Comment deleted
 
pentacular profile image
pentacular

Your claim is that "int* a;" is more portable and less confusing.

So I'm asking what "int* a, b;" does to see if you've really thought it through.

What is the type of b given this declaration?

 
Sloan, the sloth mascot
Comment deleted
 
pentacular profile image
pentacular • Edited

So, given "int* a, b;" what is the type of b?

 
Sloan, the sloth mascot
Comment deleted
 
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. :)

 
Sloan, the sloth mascot
Comment deleted
 
pentacular profile image
pentacular

By all means. :)