title: Using strtok tokens in if statements
body: <p>I'm trying to get my head around how to split arrays and use the tokens in an if statement, however I'm not having much luck.</p>
  
  <p>The below code is for an Arduino.  What I am doing is passing the function receviedChars which will be something like:</p>
  
  <blockquote>
    <p>token0,token1,token2</p>
  </blockquote>
  
  <p>When i print out func, it reads out <code>c</code>, so I figured that if I compared func to <code>c</code> it should match true.  Unfortunately, this doesn't seem to happen.</p>
  
  <p>I'm quite new to C++ and Arduino, and mainly have a web development background so I might be misinterpreting something</p>
  
  <pre><code>const byte numChars = 32;
  char receivedChars[numChars];
  </code></pre>
  
  <hr>
  
  <pre><code>char *chars_array = strtok(receivedChars, ",");
  char *func = chars_array;
  
  Serial.println(func);
  if(func == 'c') {
      Serial.println("It works");
  }
  </code></pre>
  
  <p>Could someone help me with where I am going wrong please?</p>