A carriage return \r
moves the cursor to the beginning of the current line. A newline \n
causes a drop to the next line and possibly the beginning of the next line; That's the platform dependent part that Alexei notes above (on a *nix system \n
gives you both a carriage return and a newline, in windows it doesn't)
What you use depends on what you're trying to do. If I wanted to make a little spinning thing on a console I would do str = "|\r/\r-\r\\\r";
for example.