title: Arduino / C: Convert byte array to string or other comparable text format
body: <p>I am using some third party libraries for some third party hardware. The libraries communicate with the hardware over a serial connection. Using the libraries I send data over the serial interface to the hardware and get a response, which is stored in an array:</p>
  
  <pre><code>// This is the byte array declared in the third party libraries
  // that stores data sent back from the external hardware
  byte comm_buf[201];
  
  /* I send data to hardware, comm_buf gets filled */
  
  // Printing out the received data via a second serial line to which
  // I have a serial monitor to see the data
  
  for (int i = 0; i &lt;= 50; i++) {
    Serial.print(gsm.comm_buf[i]);
  }    
  
  // This is printed via the second monitoring serial connection (without spaces)
  13 10 43 67 82 69 71 58 32 48 44 51 13 10 13 10 79 75 13 10 00
  
  // It is the decimal ascii codes for the following text
  +CREG: 0,3 
  </code></pre>
  
  <p>How can I convert a byte array into a format that I can evalute in code so I can perform an operation like the following pseudo code;</p>
  
  <pre><code>byte comm_buf[201];
  
  /* I send data to hardware, comm_buf gets filled */
  
  if (comm_buf[] == "CREG: 0,3" ) {
    // do stuff here
  }
  </code></pre>
  
  <p>Do I need to convert it to a string some how, or compare to another char array perhaps?</p>