> i am working a some C++ software that will run both on windows and linux.
> development is done on windows with VS .NET 2003.
[quoted text clipped - 4 lines]
> why does the VS editor do this, and what can i do to make it stop doing
> it?
Ctrl-m is a carriage-return (13. == 0xD).
<background ramble>
In the dark old days of teletypes and such, one character - the carriage
return - moved the print-head to the left-most spot, and another - the line
feed (ctrl/j, 10. = 0xA) moved the paper up one click. Some environments use
both characters written "\r\n" C and C++ to signify the end of line.
</background ramble>
Any decent utitility to copy text between platforms should be able to map
"\r\n" to "\n" and vice versa.
It is folly, though, to assume that either platform is wrong not to adopt
the convention of the other.
Regards,
Will
Carl Daniel [VC++ MVP] - 22 Mar 2005 20:19 GMT
>> i am working a some C++ software that will run both on windows and linux.
>> development is done on windows with VS .NET 2003.
[quoted text clipped - 20 lines]
> It is folly, though, to assume that either platform is wrong not to adopt
> the convention of the other.
In addition to Will's comments, you can tell VS to save the file with "Unix"
line endings. Once you've saved files with a particular line ending
convention, VS will maintain it (i.e. if it was Unix line endings when the
file was opened, it'll save it that way).
To change the line endings, do File|Save As... and click the little
drop-down arrow on the Save button to bring up the "Save With Encoding"
dialog. Here you can pick an encoding (UTF-8, Code page blah blah, etc) and
you can pick the line endings to use.
-cd
Bruno van Dooren - 22 Mar 2005 21:26 GMT
great.
thanks for the tip.
not that i care one whit whether it is \r\n or \n, but i want it to look the
same on both platforms.
in that case, \n is the best solution.
Bruno.
>>> i am working a some C++ software that will run both on windows and
>>> linux.
[quoted text clipped - 33 lines]
>
> -cd