Jump to content
  • Advertisement
Sign in to follow this  
M-374 LX

C/C++ newline under Windows

This topic is 2499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Under Windows, the newline sequence is CR+LF. Will C/C++ file reading operations work properly if a lone LF is found when reading a file under this operating system?

Share this post


Link to post
Share on other sites
Advertisement
Yep. The translation from \r\n is done before the methods consider the input. If you consider getline, it reads until the delim character is found, which by default is \n.

The only time I ever remember having to worry about this was when constructing text on the Windows clipboard, where \r\n in the correct order was required to create a line break.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!