I have the structure defined in the code below and need to insert a new string into the middle of the string array. I know there is a way to insert a new element with a vector. Does anyone know how to do this. I have tried several variations similar to uniqueList.word.insert(400,"disisdabomb"); but with no luck. Thank you in advance
There's no "built in" way to do it. You'll have to do the insertion yourself. This means "moving" all the elements over 1 space to make room. You can do that fairly easily in a for loop.
EDIT: actually... rather than writing the for loop yourself... you could move them all with move_backward() (or copy_backward() if you're still not using C++11), defined in the <algorithm> header:
If possible you can use std::string and all you have to do is <string_name>.insert(iterator/index,sub-string).
It will insert the string before the index there are more helpful overloads of this function as well as a insert_after() function.
Refer this site's references.