I know that. I meant that “abc” + “def” is most likely illegal (although “abc” + ‘d’ is not).
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 *.
String catenation ("adding") by adjacency (no visible operator) is a thing; "add" doesn't imply that we are talking about a + operator:
$ awk 'BEGIN { x = "abc-" 2 + 2 "-def"; print x}'
abc-4-def execl("/bin/sh", "/bin/sh", "-c"
"echo foo", (char *) NULL);
Here we get one "-cecho foo" argument passed to the shell instead of two, so it can't work.Initializers are another example:
char *strArray[] = {
"how", "now"
"brown", "cow"
};
In non-variadic function and macro calls, you will most likely get an insufficient arguments error, unless another mistake compensates for that.