Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
pjc50
11mo ago
0 comments
Share
The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.
0 comments
default
newest
oldest
sehansen
11mo ago
The real horror is "1d9" + 1 = 2, as does PHP:
https://3v4l.org/Dn6Sm
manwe150
11mo ago
I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it
hoseja
11mo ago
The pointer arithmetic works both ways, same as square brackets.
j
/
k
navigate · click thread line to collapse