I'm using c/c++ compiler on Ubuntu 14.04 and I've typed all the programs using Gedit text editor.

But the problem is that now I need to open them in Windows 8 with Notepad, but when I tried to open .c files that are created in Ubuntu in Notepad they are displaying like a paragraph but not line by line.

So I need the programs to be displayed line by line as in Gedit . The only method I found was to edit each and every line in the program as to be displayed as line by line.

  • Just don't use notepad... it just doesn't support UTF-8
    – Braiam
    May 17 '14 at 18:58

It's true that Notepad is not a good editor and that it's basically Notepad's fault. But the actual problem is this: Line ends are stored differently among operating systems. Unix (Ubuntu) usually use the symbol "LF" and Windows (Notepad too, because of that) "CR+LF". You can set the line ends to CR+LF in Gedit (you need to search the option yourself, you should find it somewhere) and Notepad will be happy. But in the long term you'll be happier with Notepad++ or I think Geany runs on Windows too.

  • where LF stands for "Line Feed", and CR stands for "Carriage Return" — as in, old typewriters. More on this here.
    – Levente
    May 29 at 5:31

Notepad is not a good editor. Try to use Notepad++ the code should be displayed correctly.


As suggested by @giuseppe and @Nobidy, notepad++ is the best choice. However you can use also wordpad, which is provided with the operating system.

Not the answer you're looking for? Browse other questions tagged or ask your own question.