title: finding character in string C language
body: <p>I am searching a character at first occurence in string using the following code. 
  But it is taking some time when the character is too long or the character that I am 
  searching is at far extent, which delays other operations. How could I tackle this problem. The code is below here.</p>
  
  <p>Note: <code>attrPtr</code> is a <code>char *</code> which holds a reference to a string containing <code>'"'</code> character at far extent. </p>
  
  <pre><code>int position = 0;
  
  char qolon = '"';//character to search
  
  while (*(attrPtr + position++) != qolon);
  
  char* attrValue = NULL;
  
  attrValue = (char*)malloc(position * sizeof(char));
  
  strncpy(attrValue, attrPtr, position-1);
  </code></pre>