3

Vector of Characters (Id-1498)

Bonus Practice Sheet Winter 2018 [17-Mar-2018 to 7-Apr-2018]

Program ID- 1498

Design a class charVector that has a character vector as datamember. Provide member functions in the class to createVector, duplicateVector, duplicateRevVector and print. Functions shall be defined as follows: initializeVector – read a string and create a vector of characters duplicateVector – Add the content of the vector once at the end. For example if the content of charVector is “bat” then after the function is called the content must “batbat” duplicateRevVector – Add the content of the vector in reverse at the end. For example if the content of charVector is “bat” then after the function is called the content must “battab” print – Print content of vector, use iterators for traversal Use the vector class defined in STL for the implementation. Use [] operator in functions duplicateVector, duplicateRevVector and use iterator in print and initializeVector functions.

Code

Please Comment Working if the code worked to you

If you have other working codes please comment the codes enclosing with <pre> and </pre> 🙂

Example: <pre> Your Code </pre>

C++ Code 

The Above Codes are for reference only. It doesn't mean everyone to directly copy/paste those codes.

 

Click Here to Leave a Comment Below 3 comments
Tarunya - April 1, 2018

this code isn’t working.




2



0

Reply
abc - April 2, 2018

please upload the correct code.




2



0

Reply
suraj - April 5, 2018

PLease upload the correct code broh the code is not working……………………




0



0

Reply

Leave a Reply:

This site uses cookies and by using the site you are consenting to this.