title: Calculating a 16 bit checksum?
body: <p>Working with a program in c that reads in a file and then I have to do both 8 bit and 16 bit checksum for a program.I only have 8 bit checksum done so far.</p>
  
  <p>This is what I understand</p>
  
  <p>I read the file and store the information in an array of characters and at end it takes the newline feed. so for example to calculate 8 bit check sum this is what happens essentially </p>
  
  <p>File has 3 letters total ( 3 a's and a newline feed)</p>
  
  <p>so array holds 4 chars  aaa+(newline)  (97+97+97+10)</p>
  
  <p>To my understanding I add all the bytes in the array then do % 256 and that is my checksum. </p>
  
  <p>97 * 3 =  //3 a's (small a ) pulled from ascii table from what I understand</p>
  
  <p>291 + 10 = 301 // + newline</p>
  
  <p>301 % 256 = cc in hex // </p>
  
  <p>however I am getting confused on how to calculate the 16 bit checksum because I can't add 2 characters at a time if its a single character array?</p>
  
  <p>any help would be greatly appreciated </p>