Skip to content

Instantly share code, notes, and snippets.

@jlgarridol
Last active May 5, 2016 22:04
Show Gist options
  • Save jlgarridol/b0222cb4d0b9385da0a32b782dccb3cb to your computer and use it in GitHub Desktop.
Save jlgarridol/b0222cb4d0b9385da0a32b782dccb3cb to your computer and use it in GitHub Desktop.
/*prototype*/
size_t stringlength(char[]);
/*funcion*/
/**
*Title: stringlength
*Description: A implementation to calculate string length when the return of strlen don't work correctly
*@param chain[] - string which will be calculate length
*@return i - a lenght of stringlenght
*@author: José Luis Garrido Labrador (JoseluCross) from JKA Network <contacto@jkanetwork.com>
*@date: 05/05/2016
*Licence: Apache 2.0
*/
size_t stringlength(char chain[]) {
size_t i;
for(i = 0; chain[i] != '\0'; ++i) ;
return i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment