Suppose that s1 and s2 are two strings, given as follows:
string s1("I have a dream"); string s2("Computer Programming");
Assume that each expression is independent. What are the results of the following expressions?
(1) s1.append(s2)
(2) s1.append(s2, 9 , 7)
(3) s1.append("NEW" , 3)
(4) s1.append(3 , 'N')
(5) s1.assign(3 , 'N')
(6) s1.assign(s2, 9 , 7)
(7) s1.assign("NEWNEW" , 3)
(8) s1.assign(3 , 'N')
(9) s1.at(0)
(10) s1.1ength()
(11) s1.size()
(12) s1.capacity()
(13) s1.erase(1 , 2)
(14) s1.compare(s3)
(15) s1.compare(0 , 10 , s3)
(16) s1.c_str()
(17) s1.substr(4 , 8)
(18) s1.substr(4)
(19) s1.find('A')
(20) s1.find('a' , 9)
(21) s1.rep1ace(2 , 4 , "NEW")
(22) s1.insert(4 , "NEW")
(23) s1.insert(6 ,8 , 'N')
s1.empty()
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.