title: How do I find the index of a character within a string in C?
body: <p>Suppose I have a string <code>"qwerty"</code> and I wish to find the index position of the <code>e</code> character in it. (In this case the index would be <code>2</code>)</p>
  
  <p>How do I do it in C? </p>
  
  <p>I found the <code>strchr</code> function but it returns a pointer to a character and not the index.</p>