Hacker News new | ask | show | jobs
by davidkclark 4706 days ago
It's pretty easy to convince yourself that "* with the type" is wrong when you see this:

int* a, b; // a is int* but b is int

1 comments

Bingo, that's the exact reason to pair the asterisk with the variable name. Especially in C-family languages where you can actually end up with code that compiles and even works, until it breaks. Think pointer arithmetic on something you assume is a pointer to a signed integer...