Question: Write a function with prototype string foo(string w) that returns a string that has 1 copy of character 0 of w, 2 copies of character
Write a function with prototype string foo(string w) that returns a string that has 1 copy of character 0 of w, 2 copies of character 1, and so on. For example, if w is the, your function would return thheee. Dont forget that you may only use those string library functions mentioned on the cover page The only library functions you are allowed to use are: cmath, climits, cstdlib: all String: empty, length, concatenation, indexing/at, relational operators iostream: >, getline (with cin, cout, cerr) fstream: all of above, open, close, eof, fail 
7, (XXX%) Write a function with prototype string foo(string w) that returns a string that has 1 copy of character 0 of w, 2 copies of character 1, and so on. For example, if w is "the, your function would return "thheee". Don't forget that you may only use those string library functions mentioned on the cover page
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
