Hacker News new | ask | show | jobs
by wott 1621 days ago
> I meant that “abc” + “def” is most likely illegal

That would be adding 2 pointers, and that's indeed illegal.

However, you can subtract them: “abc” - “def” . Now, the result is not a pointer any more, it's a ptrdiff_t (an integer type), so most compilers will warn if you try to assign that to a char *.