Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
C Constructs That Don't Work in C++ (lospi.net)
3 points by ingve on May 16, 2019 | hide | past | favorite | 3 comments


Josh Lospinoso, the author of this blog, has now corrected this to read "pointer to const int"

C declaration syntax confounds even the experts.

I highly recommend this article to all interested in C and C++, and programming languages generally.


"... const int* x_ptr_3 = &x; // (3) ... Finally, we see the preferred approach, which is taking a const pointer (3)"

Not a const pointer, but a pointer to const int.


Thank you for the correction!




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

Search: