Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created March 28, 2012 20:32
Show Gist options
  • Save jbclements/2230268 to your computer and use it in GitHub Desktop.
Save jbclements/2230268 to your computer and use it in GitHub Desktop.
One way to add string lengths
int numChars(char* word)
{
int i, j, sum = 0;
for(i = 0; word[i][j] != '\0'; i++)
{
for(j = 0; word[i][j] != '\0'; j++)
{
sum++;
}
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment