Comment

Comment by _kst_

The advice about storing pointers in integers:

http://cpphints.com/hints/7

is poor. It points out that converting a pointer value to "unsigned long" so you can perform arithmetic on it is a bad idea -- which is perfectly correct. But it advises just using a different integer type, such as "uintptr_t". The correct solution is to use pointer arithmetic. Don't store pointers in integers, store pointers in pointers; that's what they're for.

I've sent a comment to the author.

parent _kst_ 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton