News for hackers. Stuff that matters.
Re:Code != computer science by userbinator on Tuesday December 24, 2013 @01:20AM (#6958501)
What I find when I work with "pointy" data structures is that it really, really helps to draw diagrams to clarify your thinking. I can write a doubly-linked list extraction with my eyes closed (and it'd probably help to do it with closed eyes, since I can more easily picture what's going on) but it very likely won't look anything like yours... what's dec for? And all the extraneous underscores in the variable names, I don't see why you need them. What's wrong with p and p?
Re:Code != computer science by electronvolt on Tuesday December 24, 2013 @05:59PM (#6961455)
Drawing diagrams is one of the most useful teaching strategies I've found when people are just starting to learn pointers. I've TA'd a course that introduces students to C++, pointers, and basic data structures, and after five semesters, I'd say that it's the single most helpful thing I've found when they are first trying to wrestle with pointers. (They get to implement a doubly linked list.)
Re:Code != computer science by NAFV_P on Tuesday December 24, 2013 @04:00AM (#6958789)
One underscore indicates a pointer, two indicates a pointer to pointer.