jw013 points out in another answer that Mac has now switched to the *nix standard
Previously, Mac OS was
\r (carriage return, 13/0x0D); Windows is
\r\n, and *nix are
\n (linefeed, 10/0x0A). I'm not certain for the more obscure systems, but I'd guess nearly everything else is also
\n. The difference comes from the days of the teletype when
\n would move to the next line, and
\r would move the head back to the start (left side) of the page, quite similar to what one had to do (manually) with a typewriter back in the day. Note that in a terminal on Linux,
\r still moves the cursor to the beginning of the current line instead of moving down to the next line, consistent with its teletype use. I've seen more detailed histories on why each system chose their own line types, so I'm sure you can search for more details.
Anyway, in practical matters, most editors (except notepad) can deal with any of the three types, and there are plentiful ways to convert between them. Some remote copy tools (ftp, for instance, and probably other similar programs) even convert transparently to the correct line types for the destination when transporting files in text mode. And I read today on a SO post1 that gcc actually converts
\n to the appropriate line ending for the system it's compiling on.
The varying line-ending characters don't matter, assuming the file is open in text mode, which is what you get unless you ask for binary. The compiled program will write out the correct thing for the system compiled for.