Comment by pjc50 Comment by pjc50 3 months ago 3 replies Copy Link View on Hacker News The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.
Copy Link sehansen 3 months ago Next Collapse Comment - The real horror is "1d9" + 1 = 2, as does PHP: https://3v4l.org/Dn6Sm Reply View | 0 replies
Copy Link manwe150 3 months ago Prev Collapse Comment - I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it Reply View | 1 reply Copy Link hoseja 3 months ago Parent Collapse Comment - The pointer arithmetic works both ways, same as square brackets. Reply View | 0 replies
Copy Link hoseja 3 months ago Parent Collapse Comment - The pointer arithmetic works both ways, same as square brackets. Reply View | 0 replies
The real horror is "1d9" + 1 = 2, as does PHP: https://3v4l.org/Dn6Sm