Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, it is unintuitive. However, there's a reason people do it the unintuitive way, and that's due to the C spec.

  float* foo, bar;
This code declares bar as a float, not a pointer! To make things less misleading, most C programmers have adopted the convention of putting the star next to the variable name instead of the type:

  float *foo, bar;
even though it looks weird.


Yea I am aware of this quirk and just avoid declaring multiple pointers like that because it's confusing just to look at, plus error prone.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: