The newline character (\n) is equivalent to the ASCII linefeed character (hex 0A)

Article translations Article translations
Article ID: 48885 - View products that this article applies to.
This article was previously published under Q48885
Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003 support both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code. Microsoft Visual C++ 2005 supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model.
Expand all | Collapse all

SUMMARY

The newline character (\n) is equivalent to the ASCII linefeed character (hex 0A). Thus, for files opened in text mode, CR/LF pairs are read in as newline characters, and newline characters are written as CR/LF.

This information applies to STDIN, STDOUT, and STDERR, which are opened in text mode by default.

When using strtok() to extract tokens separated by CR/LF in a file opened in text mode, only \n must be used as a token delimiter.

Properties

Article ID: 48885 - Last Review: January 9, 2006 - Revision: 5.0
APPLIES TO
  • The C Run-Time (CRT), when used with:
    • Microsoft C Professional Development System 6.0a
    • Microsoft C Professional Development System 6.0a
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 1.5 Professional Edition
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 4.0 Standard Edition
    • Microsoft Visual C++ 5.0 Standard Edition
    • Microsoft Visual C++ 6.0 Service Pack 5
    • Microsoft Visual C++ 2005 Express Edition
    • Microsoft Visual C++ .NET 2003 Standard Edition
    • Microsoft Visual C++ .NET 2002 Standard Edition
Keywords: 
kbinfo KB48885

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com