Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void calcCount(char *arr, char *r, int *count)
- {
- int max = 1;
- for (int i = 0; arr[i] != '\0'; i++)
- {
- if (arr[i] == arr[i + 1]){
- max++;
- if (max > *count){
- *count = max;
- *r = arr[i];
- }
- }
- else max = 1;
- }
- }
- ...
- calcCount(arr, &r, &count);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement