Created
March 28, 2012 20:32
-
-
Save jbclements/2230268 to your computer and use it in GitHub Desktop.
One way to add string lengths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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