Explore BrainMass
Share

Data structures C++

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

The free newString() takes string objects strA and strB as arguments. For its action, newString() compares the string by using < and returns the concatenation of the arguments, with the lesser sring coming first.
a) give a function prototype for newString()
b)Give the implementation for newString()
c) The main program has the following string declarations, which should be used for parts (i) and (ii)
sring A = "String", B = "cat";
i) cout<< newString(A,B) //Output:_________
ii) cout<< newString(A,"C++"); // Output: _______

© BrainMass Inc. brainmass.com March 21, 2019, 4:19 pm ad1c9bdddf
https://brainmass.com/computer-science/cpp/data-structures-c-181579

Solution Preview

a) give a function prototype for newString()
string newString(string strA, string strB)
b)Give the implementation for newString() ...

Solution Summary

The function prototype for newString() is given with the implementation. A c++ code is given for this analysis.

$2.19