Possible Duplicate:
Something like print END << END; in C++?
In a shell script or in a perl program the so called "HERE" documents are commonly used for longer text, e.g. Perl:
my $t=<<'...';
usage:
program [options] arg1 arg2
options:
-opt1 description for opt1
-opt2 description for opt2
...
print $t;
This style is very well readable, e.g. no need to escape quotes or to explicitly insert \n
.
I am wondering if there is a comparable elegant approach to embed a longer text inside a C/C++ program?
#include <iostream>;
int main(void) {
std::string t;
// t = ... the same long text as in the perl example in a HERE document fashion ...
std::cout << t;
return 0;
}
EDIT: Simplification: there is no variable interpolation needed.