title: Showing the difference between 2 char * strings in C
body: <p>I am new to C, and I am trying to figure out the best way to approach this problem. I have 2 strings that are both <code>char *</code>'s.</p>
  
  <p>They have multiple \n characters within the strings themselves, and they are usually about 1000 characters in length. I want to display only single lines that are different. Typically only one character (or a relatively small number) would be different in the entire string. So I was hoping to make it so that I could display only that one changed line (the whole string from \n to \n).</p>
  
  <p>I'm not asking for anybody to write the code, or even supply code examples, just in theory what would be the most efficient way to do this?</p>
  
  <p>I've been looking into using strtok, using the '\n' symbol as a delimiter, and then using strcmp to compare the two strings, and if they were not equal then I could add that string to a "old_data" and "new_data" array. Would this be a bad way to do this?</p>
  
  <p>Any advice would be a huge help.</p>