Is there anyway to do something like PHP’s
print << END
yadayadayada
END;
in C++? (multi-line, unescaped, easy-to-cut-and-paste stream insertion)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This answer is now out of date for modern C++ – see sbi’s answer for the modern way.
This is the best you can do:
Not as convenient as a proper heredoc, but not terrible.