pjc50 9 months ago

The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.

  • manwe150 9 months ago

    I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it

    • hoseja 8 months ago

      The pointer arithmetic works both ways, same as square brackets.

baq 9 months ago

or the most sane, depending on context... e.g. awk and perl do this.