An escape code is one that uses a special character to change the meaning of other characters (aka a contex-sensitive code.) Usually the escape character, backslash in your case, is one of the normal characters. To replicate the escape code's normal character, you escape the escape code. For your example: \\ to get a normal backslash.
You are probably talking about the escape code used to format C and C++ strings used with printf for program output. See
printf for a good reference. Also, some
Tips on printf contains a handy Special Character table of printf escape codes.
Normally \n and \r are newline and carriage return. With a typewriter printer, both characters are needed to end a line of text. The newline would advance the paper 1 line and the carriage return moved the print head to the first column. Character-oriented file systems like those on Microsoft, Apple and Unix operating systems tend to use either one (\n for Unix, \r for Apple) or both (\n\r on Microsoft DOS and Windows) to indicate the end of a line in a plain text file.
Conversion is usually needed to make such plain text files usable once copied between file systems with different codes (e.g. with recode, dos2unix or unix2dos.) When this conversion is carried out on binary files, this usually destroys the content as binary files usually don't have normal lines of text. Not only would lines not be delimited by \n or \r but also a line (record) in a binary file could be the length of the whole file with \n and \r standing in for special codes for the program that reads the binary file.
Similar codes are used for command line interfaces (CLIs) such as the
bash and other shells. The can include the \t tab code and the \v vertical tab code.
The '\' escape code is far from the only one in common use. See the
ASCII Table of ANSI Escape Codes for DOS (cmd.exe) and some Unix or Linux terminals.