Whenever I am compiling my cpp file on LMS and in return Style error is coming with this sentence. One or more unexpected \r (^M) found;better to use only a \n [whitespace/newline] [1]??
Asked
Active
Viewed 711 times
1 Answers
0
Sounds like your compiler is complaining about CRLF-encoded files (DOS/Windows) instead of LF-only, as per UNIX/POSIX conventions.
You may need to adjust your editor to save in the correct format.

tadman
- 208,517
- 23
- 234
- 262
-
Brother How can I do that? – HafeezcsWhiz Oct 27 '20 at 19:49
-
If my code is.. – HafeezcsWhiz Oct 27 '20 at 19:49
-
Depends on your editor. It's a setting in most. – tadman Oct 27 '20 at 19:49
-
// Copyright 2020 Minxuan Cai #include
– HafeezcsWhiz Oct 27 '20 at 19:49 -
Editor, not code. Editor. – tadman Oct 27 '20 at 19:50
-
it just Showing error on the very beginning.. – HafeezcsWhiz Oct 27 '20 at 19:50
-
Every single line will have this problem if you have CRLF issues. – tadman Oct 27 '20 at 19:50
-
@HafeezcsWhiz The code is irrelevant, it's the editor settings that matter. – john Oct 27 '20 at 19:51
-
Suggest me any editor where I can set this code..I have done this code on DevC++ . – HafeezcsWhiz Oct 27 '20 at 19:51
-
Check the DevC++ settings. I've never used that before, but there should be a "file encoding" settings option. – tadman Oct 27 '20 at 19:53
-
For me this helped: just try retyping your code manually, you may have copied it from an editor with different format. just retype it in the editor you run your spelling checker on. – Or b Jan 20 '21 at 12:44