Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void countChars(char * string, unsigned * lowercase, unsigned * uppercase, unsigned * digits, unsigned * otherChars) {
- // Code here
- *lowercase=0;
- *uppercase=0;
- *digits=0;
- *otherChars=0;
- for(int i=0;i<strlen(string);i++)
- {
- if(islower(string[i]))
- {
- (*lowercase)++;
- }
- else
- if(isupper(string[i]))
- {
- (*uppercase)++;
- }
- else if(isdigit(string[i]))
- {
- (*digits)++;
- }
- else(*otherChars)++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement