title: C++: Get index of char element in array
body: <p>I need to get number of character in array.</p>
  
  <pre><code>const char myarray[5] = {'0', 'a', 'e', 'f', 'c'}; // Create array of char
  int number=0; // Create variable
  number = getposition(myarray, 'f'); // Now number equals to 3
  number = getposition(myarray, 'z'); // -1, because array doesn't have this char
  </code></pre>
  
  <p>My task is easy because array don't have repeating characters (for example, it can't be smth like this: {'a', '1', 'f', 'a'}). How can I do it?</p>