Problem

Character Functions. Many areas of engineering use problem solutions in which we search fo...

Character Functions. Many areas of engineering use problem solutions in which we search for a specific pattern of information in a signal. The following problems develop a set of functions for this purpose.

Rewrite the function from Problem such that each pair of characters is counted as a repeat. Thus, the string "hisssss" would have four repeated characters. Assume that the function has the following prototype statement:

int repeat2(char *ptr);

Problem

Character Functions. Many areas of engineering use problem solutions in which we search for a specific pattern of information in a signal. The following problems develop a set of functions for this purpose.

Write a function that receives a pointer to a character string and returns the number of repeated characters that occur in the string. For example, the string "Mississippi" has three repeated characters. Do not count repeated blanks in the string. If a character occurs more than two times, it should still only count as one repeated character; thus, "hisssss" would have only one repeated character. Assume that the function has the following prototype statement:

int repeat(char *ptr);

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 6