3 ms·
> "The only concept people struggle with is pointers, but even that is a very simple concept. " The concept of pointers is simple, but their implementation has
by SeanDav 9y ago
> "The only concept people struggle with is pointers, but even that is a very simple concept. "
The concept of pointers is simple, but their implementation has all sorts of subtle layers:
- interactions and apparent fungibility between pointers, arrays and strings
- how about: ( * (void( * )())0)();
- what about: * (p++) vs ( * p)++ or "++ * p", "* p++" and "* ++p" (Quotes for display reasons only)
- & vs * and various combinations of these
- pointers to pointers
- pointers to arrays of strings
- pointers to allocated memory that is/are not in scope anymore.
- Null pointer
- Many others!