DEV Community

Discussion on: It's a pointer to a type, not a variable with an asterisk in its name

Collapse
 
mellen profile image
Matt Ellen

If that were the case then int * x would be a compiler error. Seems like Ritchie just made a mistake and forgot to point out that int* is a type, so everyone just kept making the same mistake.

Collapse
 
pauljlucas profile image
Paul J. Lucas

No, it wouldn't because whitespace largely insignificant. In your example, the "thing on the right" is still * x. The space doesn't matter.

What's actually more annoying about C is that when you declare something like int f(int a[4]) that it's highly deceptive since C doesn't have array parameters.