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