Y
Hacker News
new
|
ask
|
show
|
jobs
by
pjc50
436 days ago
The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.
2 comments
sehansen
436 days ago
The real horror is "1d9" + 1 = 2, as does PHP:
https://3v4l.org/Dn6Sm
link
manwe150
436 days ago
I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it
link
hoseja
430 days ago
The pointer arithmetic works both ways, same as square brackets.
link