### Map Newlines to CR

Use the #pragma mpwc_newline to set how the C compiler interprets the newline ('\n') and return ('\r') characters.

Most compilers, including the Carbide C/C++ compilers, translate '\r' to 0x0D, the standard value for carriage return, and '\n' to 0x0A, the standard value for linefeed.

However, a few C compilers translate '\r' to 0x0A and '\n' to 0x0D—the opposite of the typical behavior.

If you enable this setting, the compiler uses these non-standard conventions for the '\n' and '\r' characters. Otherwise, the compiler uses the Carbide C/C++ language’s conventions for these characters.

Also if you enable this setting, use ISO C/C++ libraries that were compiled when this setting was enabled. Otherwise, you cannot read and write '\n' and '\r' properly. For example, printing '\n' takes you to the beginning of the current line instead of inserting a new line.

This setting corresponds to the pragma mpwc_newline. To check this setting, use __option (mpwc_newline). By default, this setting is disabled.

See also “mpwc_newline”, and Checking Settings.