I encountered the following type of string literal in an open source library, which I have not seen before. It turns out that a
and b
are the same. I'm confused why the syntax of a
is correct? Does C preprocessor concatenate two strings automatically?
#include<stdio.h>
int main()
{
const char a[] =
"123\r\n"
"123\r\n";
const char b[] = "123\r\n123\r\n";
printf(a);
printf(b);
}