Y
Hacker News
new
|
ask
|
show
|
jobs
by
pmul
2645 days ago
The first example doesn't produce undefined behaviour as c++ - it just won't compile - you can't initialise that pointer to a non const int from a const int without doing something naughty like a const_cast.