Given vector.h and vector.c from the Vector ADT section of the book, modify the code so that the vector holds characters instead of integers. Define also the following new functions in vector.c: 1. void vector_from_string(vector* v, char* string) - Create vector v then copy the characters from string to v. 2. void vector_print (vector* v) - Print vector v as a string; do not end with a newline The result will implement a string that is more flexible than the standard C char* strings. In particular insertion and deletion of characters are allowed anywhere in the strings. The main program performs various actions to test the new vector. Complete main() by replacing each TODO comment with code that implements the described actions. Note: Some operations in main() occur in pairs. After the program performs the first operation, the second operation is applied to the result of the first operation, rather than the state of the vector before performing the first operation. Ex: vector = friend
Given vector.h and vector.c from the Vector ADT section of the book, modify the code so that the vector holds characters instead of integers. Define also the following new functions in vector.c: 1. void vector_from_string(vector* v, char* string) - Create vector v then copy the characters from string to v. 2. void vector_print (vector* v) - Print vector v as a string; do not end with a newline The result will implement a string that is more flexible than the standard C char* strings. In particular insertion and deletion of characters are allowed anywhere in the strings. The main program performs various actions to test the new vector. Complete main() by replacing each TODO comment with code that implements the described actions. Note: Some operations in main() occur in pairs. After the program performs the first operation, the second operation is applied to the result of the first operation, rather than the state of the vector before performing the first operation. Ex: vector = friend
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.6: The Standard Template Library (stl)
Problem 8E
Related questions
Question
Given
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr