title: How to print '\n' instead of a newline?
body: <p>I am writing a program that uses prints a hex dump of its input. However, I'm running into problems when newlines, tabs, etc are passed in and destroying my output formatting.</p>
  
  <p>How can I use printf (or cout I guess) to print '\n' instead of printing an actual newline? Do I just need to do some manual parsing for this?</p>
  
  <p>EDIT: I'm receiving my data dynamically, it's not just the \n that I'm corned about, but rather all symbols. For example, this is my printf statement:</p>
  
  <pre><code>printf("%c", theChar);
  </code></pre>
  
  <p>How can I make this print \n when a newline is passed in as theChar but still make it print normal text when theChar is a valid printable character?</p>