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

Two points.

0) I've always been extremely strong in English. I tended to get high marks in it, and according to IQ tests and the SAT, my greatest strengths are in language. Pointers gave me some trouble, the * in declarations strikes me as a terrible syntax, and corners of C syntax in general often strike me as poorly chosen. Despite this, my experience does not mimic yours, either in the trouble I had with pointers, or the eventual resolution. One day, it just clicked, and I rarely made mistakes with it again. It came to me naturally after I took a break from C and picked up Python: once I was confident in the difference between a, array[a], array[a][b], etc, in both construction and accessing in python (I originally did a mental auto-squashing similar to that in Perl, despite not knowing Perl), pointers were no longer problematic. For what it's worth, I was a self-taught newbie at this point.

1) Pointers are not ints. Casting between pointers and ints is BROKEN, as they are not the same size on many platforms, including my primary one, amd64 with linux+gcc. Please, please don't advocate doing this, or thinking about it this way.



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

Search: