I know Example 1 below is syntactically right but can the same be said about example 2?
Why is Example 2 not throwing a compiler error?
I have never seen this form of C-string initialization in any C++ book I have read.
#include <iostream>
#include <string>
int main()
{
//Example 1;
const char STR_1[] = "your_cstring";
std::cout << STR_1 << "\n\n";
//Example 2
const char STR_2[] = "your_cstring "
"your_cstring1 "
"your_cstring2 ";
std::cout << STR_2 << "\n\n";
}
Output:
your_cstring
your_cstring your_cstring1 your_cstring2
Thanks a lot and much appreciated.