This homework will give you practice with c functions as


This homework will give you practice with C++ functions as well as string manipulation.

1. Write a function with the follower header that returns a string that starts with your name (in any format) followed by any characters you choose.

std: string getCustomString () ;

Example output: "Jesse Hartloff and then some more words"

2. Write a function with the following header that takes a string and char returning the number of occurrences of the char in the string.

int countChars(std::string, char);

Example: countChars ("This is a sentence", 't' ) 1

3. Write a third function that returns the number of occurrences of a char in your custom string. int countCharsCustom (char) ;

Example using the custom string above: countCharsCustom ( If' ) 2

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: This homework will give you practice with c functions as
Reference No:- TGS01117443

Now Priced at $30 (50% Discount)

Recommended (91%)

Rated (4.3/5)