Possible Duplicate:
what does std::endl represent exactly on each platform?
I’m trying to figure out if std::endl returns \r\n, \n, or \r depending on the platform, or if it sticks with one all the time.
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.
std::endlis just a “shorthand” for'\n' << std::flush. It is not platform dependent.However,
'\n'itself is handled differently on each platform and gets replaced with'\r\n','\n', or'\r'(or something like that) if the stream is opened in text mode.